-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spotless formatting #92
base: main
Are you sure you want to change the base?
Conversation
Hi @pbaumard, We used to use the default configuration of our IDEs (IntelliJ and Visual Studio Code) that for example, 1 tabulation = 4 characters. Thus the IDE standard configurations aren't the same as the plugin configuration. The problem is that each developer have to change its configuration to be compliant with plugin configuration not to see a lot of formatting modifications in his small PR (for example). What do you think @utarwyn about it ? |
It's a simple subject, but one that needs to be discussed if we want to standardize the Java style of our Creedengo plugins. I like the use of a tool like Spotless to apply a common formatting and check when submitting if everything is compliant. But I have the impression that here we're applying the Google style for Java, which is very opinionated. I don't agree with 100% of their rules, but here we have to use them all. Well. I propose to provide configuration files for VSCode/Intellij to automatically rearrange files when saving with the editor's style. This could be a small 1st step, like you said. |
I added the VSCode/Intellij configuration files for google-java-format. Some other IDEs are also supported, see google-java-format README. For Java sources, there is no other automated code formatting tool with as many IDEs supported. About 2 chars vs 4 chars for tabs for example, one of the main points of Opinionated and automated code formatting is to stop discussing about individual preferences. This is also explained in google-java-format Wiki. |
See green-code-initiative/creedengo-common#56
Since this is just about introducing a common format defined by Spotless, a way to check the PR is: