Format files #1179

Merged
6543 merged 20 commits from qwerty287/GitNex:format into main 2 months ago
Collaborator
Reopened #1177 use https://codeberg.org/qwerty287/woodpecker-intellij-formatter
qwerty287 added 12 commits 2 months ago
057f5dab9e
format java files
6bb091ae9e Merge branch 'main' into format
877743007c
format xml files
59ed310459
format svg and yml
459cddc0da
CI: only checheck java files for now
d4b0709280
Merge branch 'main' into format
qwerty287 added the
🪒 Refactor
label 2 months ago
qwerty287 added this to the 4.5.0 milestone 2 months ago
qwerty287 self-assigned this 2 months ago
qwerty287 added 1 commit 2 months ago
9ebef8c996
Merge branch 'main' into format
qwerty287 added 1 commit 2 months ago
ccc52d288e
Fix format
qwerty287 added 1 commit 2 months ago
7abf0113f9
Fix
Poster
Collaborator

@mmarif @6543
Hmm that's really weird. I can't format RepoDetailActivity correctly, everything else is ready now. It looks like the IntelliJ formatter has a bug here. Can somebody of you try to reformat the file? Feel free to push it here for testing if it worked. Otherwise, I'll ask Jetbrains' support.

@mmarif @6543 Hmm that's really weird. I can't format `RepoDetailActivity` correctly, everything else is ready now. It looks like the IntelliJ formatter has a bug here. Can somebody of you try to reformat the file? Feel free to push it here for testing if it worked. Otherwise, I'll ask Jetbrains' support.
Owner

@qwerty287 can you show where the issue is in formatting?

@qwerty287 can you show where the issue is in formatting?
Poster
Collaborator

Not really. It is very weird because it moves one of the ActivityResultLaunchers to another place, removes some newlines (this results in } private ActivityResultLauncher ... which is not correct of course). If I run the formatter again, it changes it back again - and so on. You can check that locally by

  1. formatting the file
  2. commit changes
  3. format again
  4. now, there shouldn't be any change anymore that can be commited
Not really. It is very weird because it moves one of the ActivityResultLaunchers to another place, removes some newlines (this results in `} private ActivityResultLauncher ...` which is not correct of course). If I run the formatter again, it changes it back again - and so on. You can check that locally by 1. formatting the file 2. commit changes 3. format again 4. now, there shouldn't be any change anymore that can be commited
Collaborator

Not really. It is very weird because it moves one of the ActivityResultLaunchers to another place, removes some newlines (this results in } private ActivityResultLauncher ... which is not correct of course). If I run the formatter again, it changes it back again - and so on. You can check that locally by

  1. formatting the file
  2. commit changes
  3. format again
  4. now, there shouldn't be any change anymore that can be commited

we can ignore that specific file for now and it looks like a bug ...

... so report it upstream?

> Not really. It is very weird because it moves one of the ActivityResultLaunchers to another place, removes some newlines (this results in `} private ActivityResultLauncher ...` which is not correct of course). If I run the formatter again, it changes it back again - and so on. You can check that locally by > 1. formatting the file > 2. commit changes > 3. format again > 4. now, there shouldn't be any change anymore that can be commited we can ignore that specific file for now and it looks like a bug ... ... so report it upstream?
Poster
Collaborator

I'll do this later.

I'll do this later.
Poster
Collaborator
Reported it, https://youtrack.jetbrains.com/issue/IDEA-299065/Formatting-a-Java-file-has-weird-results-and-repeats-itself.
qwerty287 added 2 commits 2 months ago
5866ce2f52
Add a step to find correct format
qwerty287 added 2 commits 2 months ago
287376b9b7
reformat + fix
qwerty287 added 1 commit 2 months ago
ddf2df823b
Fix format and remove tmp step
Poster
Collaborator

Nice! I was able to fix the formatting by adding a temporary step which prints out the diff after formatting. After applying this diff, it's working now!

Nice! I was able to fix the formatting by adding [a temporary step](https://codeberg.org/gitnex/GitNex/commit/5866ce2f5212bfd38084440d2a768fe34e91b81b) which [prints out the diff after formatting](https://ci.codeberg.org/gitnex/GitNex/build/416/8). After [applying this diff](https://codeberg.org/gitnex/GitNex/commit/ddf2df823b2b7344d05ffe977797f7a8d80e932f), [it's working now](https://ci.codeberg.org/gitnex/GitNex/build/417/8)!
6543 approved these changes 2 months ago
6543 referenced this issue from a commit 2 months ago
6543 merged commit a7d9918b67 into main 2 months ago

Reviewers

6543 approved these changes 2 months ago
ci/woodpecker/pr/locale Pipeline was successful
ci/woodpecker/pr/check Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
The pull request has been merged as a7d9918b67.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#1179
Loading…
There is no content yet.