Skip to content

Issue #12716: Make config filenames kebab-case#12755

Merged
romani merged 1 commit into
checkstyle:masterfrom
stoyanK7:issue/12716-config
Feb 25, 2023
Merged

Issue #12716: Make config filenames kebab-case#12755
romani merged 1 commit into
checkstyle:masterfrom
stoyanK7:issue/12716-config

Conversation

@stoyanK7

Copy link
Copy Markdown
Collaborator

Part of #12716

<suppress id="properCurlCommand" files="release\.sh"/>

<suppress id="kebabCaseFileNamingInConfigFolder"
files="config[\\/]StarterRuleSet-AllRulesByCategory\.groovy\.txt"/>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This file was dubious. Not sure if I should rename it and what I should rename it to.

starter-rule-set-all-rules-by-category.groovy.txt?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am ok to change name of this file

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok to merge if CI pass

Comment thread config/checkstyle-non-main-files-suppressions.xml Outdated
Comment thread .ci/validation.sh Outdated
-Dcheckstyle.configLocation=../../../config/checkstyle_checks.xml \
-Dcheckstyle.nonMain.configLocation=../../../config/checkstyle_non_main_files_checks.xml
-Dcheckstyle.configLocation=../../../config/checkstyle-checks.xml \
-Dcheckstyle.nonMain.configLocation=../../../config/checkstyle-non-main-files-checks.xml

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Why is it not finding the file? Local run fails too..

https://checkstyle.semaphoreci.com/jobs/7fc71ca3-4a6b-4cac-afd7-11ca7d5637b3#L786

cannot initialize module SuppressionFilter - Unable to find: config/checkstyle-non-main-files-suppressions.xml

@rnveach rnveach Feb 19, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not seeing why, but this is a maven run of sevntu-checks. It is not a run of Checkstyle.

@stoyanK7 stoyanK7 Feb 19, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

  mvn -e --no-transfer-progress -Pno-validations verify  -Dcheckstyle.ant.skip=false \
     -Dcheckstyle.version="${CS_POM_VERSION}" \
     -Dcheckstyle.configLocation=../../../config/checkstyle-checks.xml \
     -Dcheckstyle.nonMain.configLocation=../../../config/checkstyle-non-main-files-checks.xml

https://github.com/stoyanK7/checkstyle/blob/cbffbbaca86cf0fc8e85c192fd3feecaebd67971/.ci/validation.sh#L685-L699

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems odd, the error message doesn't say ../../, so I am thinking something is missing in the transfer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see the issue now. We are passing sevntu our XML configurations so it can run them. However, our config still references our suppression file naming and not sevntu's file naming. Sevntu still has the old name, and our configuration has the new name. Hence it is not finding the file and failing.

@stoyanK7 You must apply similar changes to sevntu just like in other PRs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Got it.

@romani romani Feb 20, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we have hardcoded file:

<module name="SuppressionFilter">
<property name="file"
value="config/checkstyle_non_main_files_suppressions.xml"/>
</module>

we need it to be like:

<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>

So in this case sevntu can stay on names of file it needs to be.

So before mergin this PR we need 1 PR for checkstyle repo to make it as variable and 1 PR for sevnu to define this variable.
sevntu still need to use released version of checkstyle config, so it will take some time before sevntu updated to latest of checkstyle (due to dependency to eclipse-cs)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@rnveach We have to merge sevntu-checkstyle/sevntu.checkstyle#989 first, before merging this:
https://checkstyle.semaphoreci.com/jobs/2c087901-7776-40ab-9a1a-30350c48a94d#L639

[ERROR] [checkstyle] [ERROR] /home/semaphore/checkstyle/.ci-temp/sevntu.checkstyle/sevntu-checks/config/CheckstyleFormatterForEclipse.xml:1: Filename should be in kebab-case. [kebabCaseFileNamingInConfigFolder]
[ERROR] [checkstyle] [ERROR] /home/semaphore/checkstyle/.ci-temp/sevntu.checkstyle/sevntu-checks/config/checkstyle_non_main_files_suppressions.xml:1: Filename should be in kebab-case. [kebabCaseFileNamingInConfigFolder]

@stoyanK7

Copy link
Copy Markdown
Collaborator Author

@rnveach Ping. This one is ready. No Error Test (openjdk11, fast pool) - CMD=.ci/validation.sh no-error-sevntu-checks will fix when this gets merged.
https://checkstyle.semaphoreci.com/jobs/3d4d5cf8-bfcc-43cb-9a75-7445f9d48660#L732
Unable to create Root Module: config {../../../config/checkstyle-checks.xml}.
unable to load header file https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java-regexp.header

@romani romani merged commit 739d833 into checkstyle:master Feb 25, 2023
@romani

romani commented Feb 25, 2023

Copy link
Copy Markdown
Member

need to make CI green sooner, if any items to improve, please share , we can improve in next PR.

@stoyanK7 stoyanK7 deleted the issue/12716-config branch February 25, 2023 19:42
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.

5 participants