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

Support of config bundles with extra configuration files #219

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions diff-java-tool/src/main/resources/pom_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<sevntu-checkstyle.version>1.44.1</sevntu-checkstyle.version>
<checkstyle.config.location>https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml</checkstyle.config.location>
<checkstyle.failsOnError>true</checkstyle.failsOnError>
<config.folder>${project.basedir}/config</config.folder>
Copy link
Member

Choose a reason for hiding this comment

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

an we avoid this default value ?
or please explain why have it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@romani
We store a java.header file under our config folder. Without the config.folder property and its reference, Checkstyle might not know where to locate java.header—it would either default to a different configuration or fail if it cannot find a valid header. By explicitly setting config.folder=${project.basedir}/config and using in the Checkstyle plugin, we ensure that our local java.header is always picked up during the build.

Please correct me if i am wrong or missing anything.

Copy link
Member

@rnveach rnveach Jan 2, 2025

Choose a reason for hiding this comment

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

Does it make more sense to rely on the project for the defaults?

For 3rd party projects, we define a properties file with basically these defaults.
https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/f01cb81dd1bb771f8471196a7787630f2a84861e/sevntu-checkstyle-sonar-plugin/checkstyle.properties

Main repo doesn't have this file and it is embedded into the ant process.
https://github.com/checkstyle/checkstyle/blob/master/config/ant-phase-verify.xml#L48

So it would require a change to main repo.

Copy link
Member

@romani romani Jan 2, 2025

Choose a reason for hiding this comment

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

we need to download such file like we do with configs NEW_MODULE_CONFIG="${{ github.workspace }}/.ci-temp/new_module_config.xml" https://github.com/checkstyle/checkstyle/blob/d1523dab4bbd520340336912ca6974905b4f41ec/.github/workflows/regression-report.yml#L555
to execute on them https://github.com/checkstyle/checkstyle/blob/d1523dab4bbd520340336912ca6974905b4f41ec/.github/workflows/regression-report.yml#L575
java.header should be file file in test-configs repository that is downloadable together with other files and java -jar "$DIFFTOOL_JAR" should execute with this variable defined to let checkstyle find java.header

I am not sure what is /config folder ?
diff-java-tool/src/main/resources/pom_template.xml is pom.xml that will be placed to filesystem during run of java -jar "$DIFFTOOL_JAR"

Copy link
Member

Choose a reason for hiding this comment

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

Check is updated to have property #224

please proceed to update workflow.

</properties>

<build>
Expand Down Expand Up @@ -62,6 +63,9 @@
<configuration>
<enableFilesSummary>false</enableFilesSummary>
<failsOnError>${checkstyle.failsOnError}</failsOnError>
<propertyExpansion>
config.folder=${config.folder}
</propertyExpansion>
</configuration>
</plugin>

Expand Down
Loading