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

NoLineWrap: add support for static imports #3892

Closed
kukreja-vikramaditya opened this Issue Mar 1, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@kukreja-vikramaditya
Contributor

kukreja-vikramaditya commented Mar 1, 2017

$ cat config.xml 
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
    <property name="charset" value="UTF-8"/>
        <module name="TreeWalker">
             <module name="NoLineWrap">
        </module>
    </module>
</module>


$ cat Main.java 
import
static
   java
   .math
   .BigInteger
   .ONE;                 //Should show violation for IMPORT

import java.math.BigInteger;

public final class Main {
  public static void main(String... args) {
    BigInteger max = ONE;
  }
}

$ java -jar checkstyle-7.6-all.jar -c config.xml Main.java
Starting audit...
Audit done.

I expect an error during audit process like the google guidelines mentioned here. But the NoLineWrap is unable to figure this. If static keyword is removed, audit prints the expected result.

@kukreja-vikramaditya kukreja-vikramaditya changed the title from False positive in to False positive in static import check Mar 1, 2017

@kukreja-vikramaditya kukreja-vikramaditya changed the title from False positive in static import check to False positive in NoLineWrap Check for static imports Mar 1, 2017

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Mar 2, 2017

Contributor

@kukreja-vikramaditya
Please, add Checkstyle configuration only for NoLineWrap check into issue description.
Good PR example #3775
Tool: http://rveach.no-ip.org/checkstyle/checkstyle.php

Contributor

MEZk commented Mar 2, 2017

@kukreja-vikramaditya
Please, add Checkstyle configuration only for NoLineWrap check into issue description.
Good PR example #3775
Tool: http://rveach.no-ip.org/checkstyle/checkstyle.php

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Mar 2, 2017

Member

@romani The issue looks valid to me.
http://checkstyle.sourceforge.net/config_whitespace.html#NoLineWrap
We already have IMPORT token, and description says we will verify import statements.

It seems we are just missing the STATIC_IMPORT token in acceptable and default.

Member

rnveach commented Mar 2, 2017

@romani The issue looks valid to me.
http://checkstyle.sourceforge.net/config_whitespace.html#NoLineWrap
We already have IMPORT token, and description says we will verify import statements.

It seems we are just missing the STATIC_IMPORT token in acceptable and default.

@rnveach rnveach added the easy label Mar 2, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 2, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 2, 2017

@romani romani added the approved label Mar 2, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 4, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 5, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 5, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 16, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 16, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 17, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 17, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 17, 2017

kukreja-vikramaditya added a commit to kukreja-vikramaditya/checkstyle that referenced this issue Mar 18, 2017

rnveach added a commit that referenced this issue Mar 19, 2017

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Mar 19, 2017

Member

Fix is merged

Member

rnveach commented Mar 19, 2017

Fix is merged

@rnveach rnveach closed this Mar 19, 2017

@rnveach rnveach added this to the 7.7 milestone Mar 19, 2017

@rnveach rnveach added the new feature label Mar 19, 2017

SergeyDzyuba added a commit to SergeyDzyuba/checkstyle that referenced this issue Mar 22, 2017

GitToasterhub added a commit to GitToasterhub/checkstyle that referenced this issue Mar 26, 2017

@romani romani changed the title from False positive in NoLineWrap Check for static imports to NoLineWrap: no support for static imports Mar 28, 2017

@romani romani changed the title from NoLineWrap: no support for static imports to NoLineWrap: add support for static imports Mar 28, 2017

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