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

Remove CheckerFramework 'RegexChecker' annotation processor #12567

Open
nrmancuso opened this issue Dec 31, 2022 · 3 comments
Open

Remove CheckerFramework 'RegexChecker' annotation processor #12567

nrmancuso opened this issue Dec 31, 2022 · 3 comments

Comments

@nrmancuso
Copy link
Member

nrmancuso commented Dec 31, 2022

https://checkerframework.org/releases/1.9.0/tutorial/webpages/user-input-cmd.html

We do not need to validate regexp input by users, since failure message generated by Checkstyle is enough:

➜  src 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="RegexpSingleline">
    <property name="format" value="..("/>
  </module>
</module>
➜  src java -jar checkstyle-10.4-all.jar -c config.xml Test.java
Starting audit...
Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed group near index 3
..(
        at java.base/java.util.regex.Pattern.error(Pattern.java:2045)
        at java.base/java.util.regex.Pattern.accept(Pattern.java:1895)

We need to remove this annotation processor and all associated suppressions.

Reasoning (from #12086 (comment)_):

having compile dependency to checker might be too much for now.
after reading documentation with example attentively, I do not think we should use this Check - Validating User Input.
We are library code, we do not know where we are configured. We throw exception to let upper level decide what to do with this exception. I think our pitest will do all required work to demand full coverage for code and validate all indexes of groups.
Again If we fail with exception - it is ok for us.

I am voting to deactivate Validating User Input.

@nrmancuso nrmancuso changed the title https://checkerframework.org/releases/1.9.0/tutorial/webpages/user-input-cmd.html Remove CheckerFramework 'RegexChecker' annotation processor Dec 31, 2022
@romani
Copy link
Member

romani commented Jan 3, 2023

@nrmancuso , @rnveach , please vote on this issue

@rnveach
Copy link
Member

rnveach commented Jan 3, 2023

I am fine with removing annotation processor.

@nrmancuso
Copy link
Member Author

I am good, but let's just comment it out and leave brief reason/ link to issue in pom.xml.

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

No branches or pull requests

3 participants