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

Issue #10924: Update TrailingCommentCheck to use code points #11422

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

MUzairS15
Copy link
Contributor

@MUzairS15 MUzairS15 commented Mar 16, 2022

Issue #10924: Updated TrailingCommentCheck to use code points

Diff Regression config: https://gist.githubusercontent.com/MUzairS15/338aa5815422d64fc1e119861cac1336/raw/ef19e01810ccc472e359e17175cb8dd5885d983c/config.xml

Proof that check requires update: #11422 (comment)

@MUzairS15
Copy link
Contributor Author

@nick-mancuso Pls review.

@nrmancuso
Copy link
Member

nrmancuso commented Mar 16, 2022

➜  java 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="TrailingCommentCheck">
            <property name="legalComment" value="^ this is ok"/>
        </module>
    </module>
</module>
➜  java cat Test.java 

public class Test {
    int x = 9; /* this is ok */
    String z = "aaaaaa"; /* violation */
    String y = "😊😊😊😊😊😊"; /* violation */
}
➜  java javac Test.java 
➜  java java -jar checkstyle-10.0-all.jar -c config.xml Test.java
Starting audit...
[ERROR] /home/nick/IdeaProjects/Tester/src/main/java/Test.java:8:26: Don't use trailing comments. [TrailingComment]
Audit done.
Checkstyle ends with 1 errors.


I would expect a violation on line 9 as well.

@nrmancuso nrmancuso self-assigned this Mar 16, 2022
@nrmancuso nrmancuso self-requested a review March 16, 2022 12:59
@MUzairS15
Copy link
Contributor Author

Updating PR

@MUzairS15 MUzairS15 changed the title minor: Removed usage of getLines in TrailingCommentCheck Issue #10924: Update TrailingCommentCheck to use code points Mar 17, 2022
@MUzairS15
Copy link
Contributor Author

Github, generate report

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor:

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item:

@nrmancuso nrmancuso requested a review from romani March 19, 2022 20:08
@nrmancuso nrmancuso assigned romani and unassigned nrmancuso Mar 19, 2022
@romani romani merged commit 41eae30 into checkstyle:master Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants