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
ZOOKEEPER-3464:enfore checkstyle in the zookeeper-server module and clean the package:admin and client #1019
Conversation
…lean the package:admin and client
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work.
we have to fix the Maven checkstyle plugin configuration, please take a look to my comments
pom.xml
Outdated
<executions> | ||
<execution> | ||
<id>checkstyle</id> | ||
<phase>validate</phase> | ||
<configuration> | ||
<configLocation>checkstyle.xml</configLocation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this way you are disabling the minimal checkstyle configuration I added to prevent the presence of '@author' tags.
As your new configuration is applied only to some limited list of packages you are implicitly disabling that check on a part of the codebase.
Please add a new '' of the plugin with your new checkstyle.xml and checkstyleSuppressions.xml
Please test manually that if you add a '@author' javadoc tag anywhere in code the PR validation fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Done.use the separate
checkstyle-strict.xml
for thezookeeper-server
module. - I check that our code base doesn't have the '@author' tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- Checks that disallowed strings are not used in comments. -->
<property name="format" value="(@author)" />
</module>
and found it doesn't work.search around and don't find a valid way to enforce no author
tag in the javaDoc.Cc @eolivelli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @maoling , you can try out enable the former simple checkstyle configuration in parent pom.xml and enable strict checkstyle configuration in, for example, zookeeper-server pkg. Make sure the strict checkstyle configuration contains rules in the simple one including forbid '@author' tag. I would provide a patch you can make use of in this week if you stuck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tisonkun
Nothing can make me get stuck, except the beautiful girls;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maoling you can take a look at ZOOKEEPER-3465 and #1022 #1023 where I show you how to enable checkstyle configuration per pkg and why I stand "no need" for extra suppression configuration.
You can rebase the subtasks enable it on zookeeper-server(i.e., this thread) on #1022 . Feel free to share you opinion because I did change the checkstyle configuration choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this awesome work @maoling!
I have several concerns about the implementations.
-
Here we do two things at once, i.e., add a configuration file and enable it on zookeeper-server. As discussed in mailing list we would at first add a configuration and then enable it per pkg so there is ZOOKEEPER-3465. At least I think we should separate these two topics into different commits.
-
Could you explain where rules in
checkstyleSuppressions-strict.xml
comes from? If we follow the process above, we could just enable it per package and there should be no suppression config needed.
|
I think we can close this pr. cc @tisonkun |
Sure. Follow the current progress whoever proceed the work on zookeeper-server would do it quite different from this pull request. |
admin
andclient
and 7 java files. Use theIDEA
git diff tool, we can easily check that I only clean the code format, not change any code logic.format codes with the keyboard shortcut: Ctrl + Alt + L),Otherwise, cleaning this things manually will make you crazy:)
ZKClientConfig
cannot pass this rule and I cannot refactor the name for the compatibility issue