Skip to content
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

EmptyLineSeparator flags commas for multiple single type variables on line #8957

Closed
linusjf opened this issue Nov 2, 2020 · 2 comments · Fixed by #8984
Closed

EmptyLineSeparator flags commas for multiple single type variables on line #8957

linusjf opened this issue Nov 2, 2020 · 2 comments · Fixed by #8984
Milestone

Comments

@linusjf
Copy link

linusjf commented Nov 2, 2020

Check documentation: https://checkstyle.org/config_whitespace.html#EmptyLineSeparator


/var/tmp $ javac Test.java

/var/tmp $ cat Test.java
public class Test {
    int readOnly;
    int p01;
    int p11;
    int q01, q02, q03, q04, q05, q06, q07, q08;
 }


/var/tmp $ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
        "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="TreeWalker">
    <module name="EmptyLineSeparator">
      <property name="allowNoEmptyLineBetweenFields"
                value="true" />
    </module>
  </module>
</module>

/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"
/var/tmp $ java $RUN_LOCALE -jar checkstyle-8.36.jar -c config.xml Test.java
Starting audit...
[ERROR] /var/temp/Test.java:5:10: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:15: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:20: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:25: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:30: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:35: ',' should be separated from previous statement. [EmptyLineSeparator]
[ERROR] /var/temp/Test.java:5:40: ',' should be separated from previous statement. [EmptyLineSeparator]
Audit done.

Expected: No violations.

@linusjf linusjf changed the title EmptyLineSeparator check flags commas for multiple single type variables on single line EmptyLineSeparator flags commas for multiple single type variables on single line Nov 2, 2020
@romani romani added the approved label Nov 3, 2020
@linusjf linusjf changed the title EmptyLineSeparator flags commas for multiple single type variables on single line EmptyLineSeparator flags commas for multiple single type variables on line Nov 3, 2020
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 13, 2020
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 13, 2020
@strkkk strkkk added the bug label Nov 13, 2020
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 16, 2020
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 16, 2020
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 16, 2020
…riables on same line

Issue checkstyle#8957: fix EmptyLineSeparatorCheck for single type variables on same line
strkkk added a commit to strkkk/checkstyle that referenced this issue Nov 16, 2020
@pbludov
Copy link
Member

pbludov commented Nov 17, 2020

Fix is merged.

@pbludov pbludov added this to the 8.38 milestone Nov 17, 2020
@linusjf
Copy link
Author

linusjf commented Nov 17, 2020

Thanks, @pbludov !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants