Code style settings #535
Code style settings #535
Conversation
Just a couple of things which I feel are off, though I may be wrong:
It might also be worth adding an EditorConfig file to the root, and doing some whitespace cleanup on the Lua files. It'd also prevent missing trailing new-lines on new files looks at My biggest worry/complaint about this, and what has stopped me in the past, is that it's going to cause merge conflicts with pretty much every PR out there. I think the better thing to do would be to set up the guidelines to ensure new code is written using them, and Dan can clean up the existing code at his leisure. |
Ohhhh. That's how I fix that one. I couldn't figure out which setting controlled that. Continuation indent, cool, I'll add it now.
It should be, but I can double check by generating the Javadoc. Where's the one that's broken over multiple lines?
There's a lot of cases where other expressions had them. I'm not a fan of it, but having the spaces removed seemed to result in a lot more changes to the code.
Good idea. Didn't think about the Lua files.
From when I've done this in the past most of Git's conflict resolution should be ok with whitespace changes. I can definitely remove the commit where I performed the cleanup; I'll do that now. I mostly used that commit to prove that I wasn't drastically changing style and instead following what was established. |
A couple of files in the public API, I think
Ahhh, that's fine. I tried to have a look at a couple of random files to see what they did, but as you say, it's not very consistent :). It's rather embarrassing going through the reformatting diff and going "oooh, that's my code which is inconsistently formatted". |
Added code style settings for IntelliJ, that way when other developers contribute to this mod their code will be more likely to match the established code style.
The settings I've used are consistent with the bulk of the code I've seen throughout,
though there were some inconsistencies that meant I got IntelliJ to reformat code to the style I setup.I recommend running some code cleanup over the existing code base.Let me know if there are any other recommendations to add to the code style settings xml file.