Skip to content

Remove exclude list from openjdk projects #881

Description

@mahfouz72

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions