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

RightCurly: ALONE option doen't work for a singleline IF #4044

Closed
Vladlis opened this Issue Mar 18, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@Vladlis
Member

Vladlis commented Mar 18, 2017

vlad@vlad-W65-67SB ~/Documents $ javac Input.java
vlad@vlad-W65-67SB ~/Documents $ java -jar checkstyle-7.6-all.jar -c my_check.xml Input.java
Starting audit...
Audit done.
vlad@vlad-W65-67SB ~/Documents $ cat Input.java

public class Input {
    void foo() {
        if (true) { getClass(); }
    }
}

vlad@vlad-W65-67SB ~/Documents $ cat my_check.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"/>
    <property name="severity" value="warning"/>

    <module name="TreeWalker">
         <module name="RightCurly">
             <property name="option" value="alone"/>
         </module>
    </module>
</module>

Expected: violation on if as option is alone

@romani romani added approved easy medium and removed easy labels Mar 18, 2017

MEZk added a commit to MEZk/checkstyle that referenced this issue Mar 18, 2017

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Mar 18, 2017

Contributor

@romani
I am on it

Contributor

MEZk commented Mar 18, 2017

@romani
I am on it

MEZk added a commit to MEZk/checkstyle that referenced this issue Mar 18, 2017

MEZk added a commit to MEZk/checkstyle that referenced this issue Mar 18, 2017

MEZk added a commit to MEZk/checkstyle that referenced this issue Mar 18, 2017

romani added a commit that referenced this issue Mar 20, 2017

@romani romani added the bug label Mar 20, 2017

@romani romani added this to the 7.7 milestone Mar 20, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Mar 20, 2017

Member

fix is merged

Member

romani commented Mar 20, 2017

fix is merged

@romani romani closed this Mar 20, 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

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