I think we should define a code convention for new & updated code in order to have the same IDE configuration everywhere and avoid syntax typo in pull requests.
Usually, I use the google convention because they provide the idea and eclipse configuration file.
@testng-team WDYT?
I agree. We could also perhaps include a editorConfig
file. In case of the formatter and user would still need to import it into their IDE for it to take effect. But in the case of editorConfig, it comes bundled with IntelliJ. Please see complete list here
They also have a plugin for eclipse that can be downloaded. Am not trying to compare this against that, but just throwing out options.
Yes, EditorConfig is another option. But we need to determine the rules before. And I think we should not apply it to the current code quickly because the diff will be too huge.
We can discuss on rules but I don't want to spend to much time because I don't care to follow rules I don't like (once they are defined).
The google convention could be a good start and we can customize it according to opinion of @testng-team
Agreed, it would be nice to have formatting rules for IDEA and Eclipse included in the project, but in my experience, it's not always easy without specifying preferences for a lot of other things in the IDE (not sure if it's still true). If it's possible to commit a file that only specifies code formatting and nothing else, great.
Also, that file should ideally define import orders so we never see imports shuffling in the PR's.
@cbeust And WDYT about the google style?
I'm fine with the Google style.
Agreed, it would be nice to have formatting rules for IDEA and Eclipse included in the project, but in my experience, it's not always easy without specifying preferences for a lot of other things in the IDE (not sure if it's still true).
This still sucks today, for import order, eclipse has a separate preference and can be exported.
For now, our team uses both Eclipse and Intellij, we use eclipse preference as the source of truth. For Intellij, there is a Eclipse Code Formatter plugin can import the eclipse preference files (including the import order one)
@missedone As proposed by @krmahadevan , editorConfig is supposed to fix configuration issues. Do you have any bad experience with it?
BTW, if we follow the google style, they already provide eclipse and intellij configuration files.
I didn't use editorConfig before, it could be a fun with trying something new, but looks like need to define the editorConfig profile from scratch to fit TestNG...
I would say let's start with google style first.
for the import order, there need to be a separate profile file.