sercuzz8 opened a new pull request, #9178:
URL: https://github.com/apache/storm/pull/9178
OpenRewrite's `TabsAndIndents` re-indent pass puts array initializer
elements at the
continuation indent and misplaces the bodies of some anonymous classes and
enum constants.
Checkstyle's `Indentation` check rejects these as errors, so the auto-fix of
`storm-client`
(run on my fork) went from 0 to 27 errors and failed `mvn validate`.
The other warnings stayed the same or decreased, depending on their category.
## Changes
- Replace the OpenRewrite re-indent pass (`checkstyle-reindent-openrewrite`)
with a Groovy
pass (`checkstyle-autofix-indentation`) that runs
`checkstyle-autofix.groovy` with only new
`Indentation` and `CommentsIndentation` fixers. These move each reported
line (plus the rest
of a reported declaration header, or a whole block comment) to the level
Checkstyle expects.
- Update the workflow, root pom, `rewrite.yml` and
`storm-checkstyle/README.md` to match.
The auto-fix still runs three passes.
## Testing
Tested locally on `storm-client`, starting from a copy that has not been
auto-fixed:
| | Before (sercuzz8/storm#2) | After |
|---|---|---|
| Errors | 27 `Indentation` | 0 |
| `mvn validate -pl storm-client` | fails | passes |
| Warnings | 7,223 | 7,149 |
Warnings per check, before the run (`master`) and after it (this PR's
tooling):
| Check | Before | After |
|---|---|---|
| LineLength | 8,227 | 4,345 |
| MissingJavadocMethod | 2,020 | 2,020 |
| MissingJavadocType | 624 | 624 |
| MatchXpathCheck#singleLineCommentStartWithSpace | 369 | 0 |
| EmptyLineSeparator | 199 | 12 |
| RequireEmptyLineBeforeBlockTagGroup | 125 | 0 |
| SummaryJavadoc | 114 | 11 |
| AbbreviationAsWordInName | 110 | 110 |
| JavadocParagraph | 73 | 1 |
| CustomImportOrder | 30 | 0 |
| MethodName | 19 | 19 |
| VariableDeclarationUsageDistance | 7 | 7 |
| **Total** | **11,917** | **7,149** |
- Compared with the output of the old tooling, the only differences are
whitespace
(`diff -r -w -B` is empty).
- Not yet tested: other modules, the updated workflow running on GitHub
Actions, and
compiling or running tests.
To reproduce:
```sh
mvn install -DskipTests -Dcheckstyle.skip=true -pl storm-client -am
mvn -pl storm-client -Dcheckstyle.skip=true \
org.openrewrite.maven:rewrite-maven-plugin:run@checkstyle-autofix-openrewrite \
org.codehaus.gmavenplus:gmavenplus-plugin:execute@checkstyle-autofix \
org.codehaus.gmavenplus:gmavenplus-plugin:execute@checkstyle-autofix-indentation
mvn validate -pl storm-client
```
## Known leftover
The closing `},` of the `SUPERVISOR` enum constant in `DaemonType.java`
stays at column 0.
Checkstyle doesn't flag it.
🤖 Generated with [Claude Code](https://claude.com/claude-code), revised by
humans
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]