Skip to content

Conversation

@Anmol202005
Copy link
Contributor

Fixes: #17717

@Anmol202005 Anmol202005 marked this pull request as draft September 4, 2025 14:13
@Anmol202005 Anmol202005 marked this pull request as ready for review September 4, 2025 17:47
@Anmol202005
Copy link
Contributor Author

@romani @rdiachenko kindly review.

@Anmol202005
Copy link
Contributor Author

Anmol202005 commented Sep 4, 2025

@romani @rdiachenko
Kindly help with the CI here.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@Anmol202005 Anmol202005 force-pushed the rewrite branch 5 times, most recently from 8cfbc97 to e2b6660 Compare September 5, 2025 18:20
@rdiachenko
Copy link
Member

rdiachenko commented Sep 5, 2025

@Anmol202005 also please fix ci/circleci: run-inspections, here's the reason:

<problems is_local_tool="true">
<problem>
<file>file://$PROJECT_DIR$/config/checkstyle.properties</file>
<line>1</line>
<module>project</module>
<entry_point TYPE="file" FQNAME="file://$PROJECT_DIR$/config/checkstyle.properties"/>
<problem_class id="AlphaUnsortedPropertiesFile" severity="ERROR" attribute_key="ERRORS_ATTRIBUTES">
Properties file or resource bundle is alphabetically unsorted
</problem_class>
<description>Properties file is alphabetically unsorted</description>
<highlighted_element>
checkstyle.cache.file=${mvn.project.build.directory}/cachefile checkstyle.header.file=config/java.he...
</highlighted_element>
<language>Properties</language>
<offset>0</offset>
<length>444</length>
</problem>
</problems>

Regarding Check PR Description, I approved the issue, so this should be fixed

@Anmol202005 Anmol202005 force-pushed the rewrite branch 2 times, most recently from d723278 to 374daef Compare September 5, 2025 20:13
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

@romani
Copy link
Member

romani commented Sep 5, 2025

https://app.circleci.com/pipelines/github/checkstyle/checkstyle/36394/workflows/f44ba7ae-00a4-4d96-abb8-a8b14a428dda/jobs/1061403?invite=true#step-103-12965_56

./.ci/validation.sh no-exception-alot-of-projects
....
Running Checkstyle on src/main/java ... with excludes {}
mvn -e --no-transfer-progress --batch-mode site -Dcheckstyle.config.location=checks-nonjavadoc-error.xml -Dcheckstyle.excludes= -Dcheckstyle.version=1.0.0-SNAPSHOT -Dcheckstyle.failsOnError=false
Running command: mvn -e --no-transfer-progress --batch-mode site -Dcheckstyle.config.location=checks-nonjavadoc-error.xml -Dcheckstyle.excludes= -Dcheckstyle.version=1.0.0-SNAPSHOT -Dcheckstyle.failsOnError=false

-Dcheckstyle.version=1.0.0-SNAPSHOT this is deinetely wrong.

sounds like we messed up fodlers of clone, see item to improve bellow.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

@romani
Copy link
Member

romani commented Sep 5, 2025

group ID should be fixed for autofix project.

@Anmol202005 Anmol202005 force-pushed the rewrite branch 3 times, most recently from b60688b to 4e4b806 Compare September 5, 2025 22:41
@Anmol202005
Copy link
Contributor Author

@romani
Copy link
Member

romani commented Sep 5, 2025

Please send PR to fix groovy regexp to be more explicit

@romani
Copy link
Member

romani commented Sep 5, 2025

Better idea, please move auto fix version to property of pom.xml, so groovy will not catch it.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@Anmol202005 Anmol202005 force-pushed the rewrite branch 2 times, most recently from 988239f to ef08198 Compare September 6, 2025 18:08
@Anmol202005
Copy link
Contributor Author

@romani done.

@Override
public void execute() {
final long startTime = System.currentTimeMillis();
long startTime = System.currentTimeMillis();
Copy link
Member

Choose a reason for hiding this comment

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

lets see how CI will detect missing "final"

Copy link
Member

Choose a reason for hiding this comment

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

@Anmol202005
Copy link
Contributor Author

Anmol202005 commented Sep 7, 2025

@romani i gguess i missed one cmd to run checkstyle first.
lets add that to the config and test it. on it.
IDK how it got removed.

@romani
Copy link
Member

romani commented Sep 7, 2025

I removed it, I am testing, restored.
Works fine on local, lets see how cI works now

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

ok to merge !

Copy link
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

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

lgtm

@romani
Copy link
Member

romani commented Sep 7, 2025

CI failure:

�[0;32mrewrite:6.17.0:run�[m �[1m(default-cli)�[m @ �[36mcheckstyle�[0;1m ---�[m
[�[1;34mINFO�[m] Using active recipe(s) [CheckstyleAutoFix]
[�[1;34mINFO�[m] Using active styles(s) []
[�[1;34mINFO�[m] Validating active recipes...
[�[1;34mINFO�[m] Project [checkstyle] Resolving Poms...
[�[1;34mINFO�[m] Project

Restarted

Restarted again.

@Anmol202005 Anmol202005 force-pushed the rewrite branch 3 times, most recently from 975a409 to 510f80d Compare September 7, 2025 18:04
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Very good for first step

@romani romani merged commit b587481 into checkstyle:master Sep 7, 2025
120 checks passed
<maven.versions.plugin.version>2.19.0</maven.versions.plugin.version>
<maven.compiler.plugin.version>3.14.0</maven.compiler.plugin.version>
<checkstyle.skipCompileInputResources>true</checkstyle.skipCompileInputResources>
<checkstyle.openrewrite.version>1.0.0-SNAPSHOT</checkstyle.openrewrite.version>

Choose a reason for hiding this comment

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

nearby release would help users to find version quicker.

./mvnw -e --no-transfer-progress -Drewrite.recipeChangeLogLevel=INFO \
rewrite:run -P checkstyle-autofix

echo "Checking for uncommitted changes..."
Copy link

@Pankraz76 Pankraz76 Sep 7, 2025

Choose a reason for hiding this comment

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

in rare cases it would actually fail, even when passing here, laking flaky state to prod.

would need to run twice to really make sure, as big changes/recipes sometimes need multiple runs mostly twice just.

17 migration changes from javax to jarkata having the need to reorder/run imports, after initial run/migration.

Just some idea, no big deal as simple rerun will fix it.

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.

Add chechstyle-operewrite recipes to the project.

4 participants