chore: format java code#23
Conversation
Dev to Main | Update dependencies
|
I think the main changes are converting tabs to spaces here. |
That is most definitely a big part of the diffs, but there are also countless places with no proper spacing e.g. between operands: "a+b" instead of "a + b", and also the doc comments were expanded from one line into three. Also different line breaking at some places |
There was a problem hiding this comment.
Looks good to me. A few places the formatting has made the readability slightly worse (e.g. switch), but I approve moving from tabs to spaces as well as some more uniformity for the usage of spaces in conditions and expressions.
However
if we ever plan on moving forward with #7 then these changes will probably make merging changes a lot more annoying.
server/src/main/java/tak/Seek.java
Outdated
| int rematchId; | ||
| public static enum COLOR {WHITE, BLACK, ANY} | ||
|
|
||
| ; |
There was a problem hiding this comment.
what kind of formatting is this where the semicolon gets pushed 2 lines down?
Ah, public static enum NAME { Fields.. } doesn't need a semicolon at all. I guess removing the semicolon here would make sense, though it doesn't change anything ^^
There was a problem hiding this comment.
I saw that, but I wanted to clean up all the places where Intellij complains anyways in another pull request (after formatting is done, so one can actually review the diff). It currently shows me 245 warnings for the java code alone. This actually also includes most of the switches that can be turned into switch expressions instead. Also there are places where C-style arrays are used (String value[]) instead of (String[] value), I didn't even know that's possible.
How so? From what I can see, that PR is exclusively TypeScript code, which I haven't touched at all. I don't think there is even a single merge conflict between the two PRs |
|
I have now reverted to tabs as per bcreature's request. I have added a .editorconfig for consistent settings across editors (some settings are intellji-only, don't know if there are vscode equivalents, also vscode needs a plugin for .editorconfig iirc). |
Code should be formatted for git diffs of my future commits to be readable. No idea why the code isn't formatted in the first place.
I haven't modified any code, I just ran the intellij idea formatter on all java files in server/src/main.