-
Notifications
You must be signed in to change notification settings - Fork 408
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
Add import order in checkstyle rules #556
Comments
I personally like less groups.
However, running that config means 179 checkstyle errors in 92 files. Running with your proposal is 114 errors in 78 files, which means less code churn. So, I'm good with your proposal, although (minor comment) I think all the groups can use prefixes instead of regexes |
No matter how many files are affected - more than 50% will have to be changed anyway... What about this:
Indeed... |
Good point.
Sounds good to me. Let's go with that. |
Related issue: logfellow#556
Related issue: logfellow#556
Related issue: logfellow#556
* Add checkstyle rule for java import statements * Fix import ordering + ban unused imports - static imports go on top in their own separate group (not mixed with other groups) - ban unused imports * Limit the check for a valid license header to .java source files only Related issue: #556
It would be nice to have checkstyle enforce the ordering of import statements as well. People are using different IDEs with different defaults. We we don't impose a particular order, imports will be constantly reorder with every commit...
Here is a first proposition:
java.*
javax.*
net.logstash.*
org.*
Each group is sorted alphabetically.
Example:
Corresponding checkstyle rule:
The text was updated successfully, but these errors were encountered: