Tillerinobot
Tillerinobot copied to clipboard
code-format standard
We need some rules about code-formatting, things like:
- tabs or spaces
- order of imports
- etc.
Afaik this is now all kinda sort of all over the place. If I edit the code in IntelliJ IDEA I have to disable all sorts of things (auto import order) otherwise I would generate HUUGE diffs with no actual change.
Ideally I would want a thing that both IntelliJ and eclipse can understand and import into their own build-in codeformatter. That means i can just run my "format code" shortcut and be sure that diffs are actual diffs and not just changes in whitespace or order of imports or whatever the crap the case may be
Import order is a pain since checkstyle and eclipse do not agree on case sensitivity. Apart from that I absolutely agree although I gotta say that this raises the bar for newer programmers. It's yet another thing that will be blocked by CI and raise questions.
On Tue, Nov 22, 2016, 14:18 Olle Kelderman [email protected] wrote:
We need some rules about code-formatting, things like:
- tabs or spaces
- order of imports
- etc.
Afaik this is now all kinda sort of all over the place. If I edit the code in IntelliJ IDEA I have to disable all sorts of things (auto import order) otherwise I would generate HUUGE diffs with no actual change.
Ideally I would want a thing that both IntelliJ and eclipse can understand and import into their own build-in codeformatter. That means i can just run my "format code" shortcut and be sure that diffs are actual diffs and not just changes in whitespace or order of imports or whatever the crap the case may be
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Tillerino/Tillerinobot/issues/105, or mute the thread https://github.com/notifications/unsubscribe-auth/ABL9ZUNhz-dlsMic_H2L7iUh1jXWljSRks5rAuo5gaJpZM4K5ZpT .
We dont have to use something like checkstyle per se, altho I'm certainly not against it.
I gotta say that this raises the bar for newer programmers
Do not fully agree. Most of the time is easy fixes and it teaches "newer programmers" code formatting standards are important.
blocked by CI and raise questions
Thats why you have me :wink:
What I suggest doing: you export whatever settings you have in eclipse (you use eclipse to dev right?) and put that file in the repo. Create a folder in the root or something and put it there. I've seen an IntelliJ plugin to import eclipse Code Formatter things, I'll do that, export it in IntelliJ format and put that file aslo in the repo. Anyone using eclipde or IntelliJ can just import one of those two files and start working if they desire.
One last note about that "raises the bar for newer programmers" things: Anyone wanting to do something with the code who is not an programmer is probably an translator. In my opinion anything translation related should be moved to text-based resource files instead of code. How? I'll think about that...
We did this for osuceleb:
https://github.com/OsuCelebrity/OsuCelebrity/blob/master/google_checks.xml https://github.com/OsuCelebrity/OsuCelebrity/blob/master/osuCelebrity-parent/pom.xml
The checks config above contains two hacks because eclipse is a piece of shit (jk luv u bae, but y u be dis way?): Ignores import order. Tolerates line length up to a few chars longer.
These are the formatter settings for eclipse and intellij: https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml
Im fine with using whatever, as long as its something so I dont have to litterally check my diff line by line for random whitespace changes in every PR i make. Up to the point where I gave up, opened up notepad++ and just did the change in there once.
Quote omk: "bruh"