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 exclude list from openjdk projects #881

Open
mahfouz72 opened this issue Jul 17, 2024 · 0 comments
Open

Remove exclude list from openjdk projects #881

mahfouz72 opened this issue Jul 17, 2024 · 0 comments

Comments

@mahfouz72
Copy link
Member

detected at #878 (comment)

openjdk 21 requires lots of excludes, list here should be consistent with file filters at https://github.com/checkstyle/checkstyle/blob/master/config/projects-to-test/openjdk21-excluded.files

This list is generated by bash/python from here.

script source code:

#!/bin/bash
OUTPUT="test"
while  [ -n "$OUTPUT" ]; do
    OUTPUT=$(.ci/no-exception-test.sh openjdk20-with-checks-nonjavadoc-error | grep "Caused by: " | grep -oh '/.*.java' | sed 's./.[\\\\\\/].g' | uniq)
    echo "$OUTPUT"
    echo -e "<module name=\"BeforeExecutionExclusionFileFilter\">\n  <property name=\"fileNamePattern\" value=\"$OUTPUT\$\"/>\n</module>" >> config/projects-to-test/openjdk20-excluded.files
    rm -rf .ci-temp/contribution
    git add .
    git commit -m "added another file filter"
done

The script runs .ci/no-exception-test.sh and pipes the output to grep "Caused by: " to filter lines containing "Caused by: ". So,
This script makes a list of all files not parsable by checkstyle and causes an exception during the run then we add those files to the exclude list. And this is basically what treeWalker is capable of, we have a property that skips files on Java parse exception. internally all the files from openjdk21-excluded.files should be skipped automatically due to

<property name="skipFileOnJavaParseException" value="true"/>
<property name="javaParseExceptionSeverity" value="ignore"/>

Given the above analysis, I see no value in having the excludes in the .properties file. I think we can remove them.

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

No branches or pull requests

1 participant