-
Notifications
You must be signed in to change notification settings - Fork 155
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
[#658] Modify checkstyle configuration #1094
[#658] Modify checkstyle configuration #1094
Conversation
@fzdy1914 @jylee-git @eugenepeh may I ask if there's any other modifications needed for the existing checkstyle? |
No other suggestion from my side. |
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.
Good catch, didn't realized that line wrap haven't been included in checkstyle.
No comment on my end but can check the Addressbook's checkstyle in case we missed out anything.
Went through with the OSS Java coding standard and every check seems to be there. Comparing with the addressbook's checkstyle.xml, they set Also, should I create an issue/PR in AddressBook as they are also missing the 8 space line wrap indentation check? [Update: done so] |
I am not sure about this rule for line-wrap, therefore just want to confirm. Shouldn't indentation and line wrap indentation be same? |
Line wrap is supposed to use double the indentation to distinct itself as line wrap and not the subordinate of previous line |
The rules on addressbook are meant to be more relax for flexible learning. Its not strictly enforce like RepoSense as we're doing actual production |
@@ -44,7 +44,7 @@ | |||
private static final Path WITHOUT_FORMATS_TEST_CONFIG_FILES = new File(RepoConfigurationTest.class.getClassLoader() | |||
.getResource("RepoConfigurationTest/repoconfig_withoutformats_test").getFile()).toPath(); | |||
private static final Path GROUPS_TEST_CONFIG_FILES = new File(RepoConfigurationTest.class.getClassLoader() | |||
.getResource("RepoConfigurationTest/repoconfig_groups_test").getFile()).toPath(); | |||
.getResource("RepoConfigurationTest/repoconfig_groups_test").getFile()).toPath(); |
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.
What is our required indentation level when we have multiple consecutive line wraps?
For example,
private static final Path GROUPS_TEST_CONFIG_FILES = new File(RepoConfigurationTest.class.getClassLoader()
.getResource("RepoConfigurationTest/repoconfig_groups_test").getFile())
.toPath();
Should the line toPath();
be indented 8 spaces to the right relative to .getResource(...
or should it be on the same level as .getResource(...
?
With the new setting, checkstyle recommends that toPath();
should be on the same level as .getResource(...
This seems ok to me.
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.
Should the line
toPath();
be indented 8 spaces to the right relative to.getResource(...
or should it be on the same level as.getResource(...
?
It should be 8 spaces to the right relative to the first line, aka private static final...
Based on some testing I did, seems that the Is this intended? |
Good catch. Think we should set it to be exactly 8 spaces. |
I've tried to set the exact 8 space indentation rule using Success checkstyle
Failed checkstyle, the new should be at same indentation as
This is a limitation with the Java checkstyle where it can't detect further line-wraps. I guess we can stick with the current "loose" rule for 8 space line wrap indentations to take into account these situations? |
I'm ok with this approach. |
* 'master' of https://github.com/reposense/RepoSense: [reposense#1047] v_summary: simplify toDisplay user logic (reposense#1051) [reposense#658] Modify checkstyle configuration (reposense#1094) Add commit message length configuration border (reposense#1048) [reposense#1061] build.gradle: remove unused dependency (reposense#1095) [reposense#1044] Update date hashes on reset date range (reposense#1068)
Fixes #658