feat: add standalone Checkstyle linting - #435
Conversation
|
Pre-release consumer validation is running in prometheus/client_java#2341. The standalone all-files run initially found 165 warnings: 160 in test sources, one archived benchmark warning, and four example-source warnings. The consumer PR preserves client_java's existing Maven Checkstyle scope with narrow suppressions; |
|
Checkstyle now uses the Aqua package from aquaproj/aqua-registry#57625. Current Flint CI failures are expected until that package is merged into the registry; the package PR is mergeable and all checks are green. |
|
CI is currently waiting for the next mise release: the Checkstyle package was merged into aqua-registry in aquaproj/aqua-registry#57625, but mise v2026.7.13 still bundles an older Aqua registry snapshot. |
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
41e1d39 to
a68fb51
Compare
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
There was a problem hiding this comment.
Pull request overview
This PR adds first-class, standalone Checkstyle support to Flint by registering a new checkstyle check (invoked via java -jar), treating warning/error markers as failures even when the process exits 0, and rounding out the integration with docs, tool pins, and focused end-to-end fixture cases.
Changes:
- Add
checkstyleto the built-in registry with baseline config expectations and failure-on-output markers ([WARN],[ERROR]). - Extend the runner/command spawning to support
java -jarinvocation and failing checks based on output patterns (stdout/stderr). - Add Checkstyle e2e cases plus generated docs and dependency/workflow pin updates.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/cases/checkstyle/warning/test.toml | New e2e case asserting warning output causes a failed check |
| tests/cases/checkstyle/warning/files/mise.toml | Fixture tool pin for Checkstyle |
| tests/cases/checkstyle/warning/files/Foo.java | Java fixture input |
| tests/cases/checkstyle/warning/files/checkstyle.xml | Minimal Checkstyle config fixture |
| tests/cases/checkstyle/missing-config/test.toml | New e2e case for missing checkstyle.xml behavior |
| tests/cases/checkstyle/missing-config/files/mise.toml | Fixture tool pin for Checkstyle |
| tests/cases/checkstyle/missing-config/files/Foo.java | Java fixture input |
| tests/cases/checkstyle/clean/test.toml | New e2e case for clean Checkstyle run |
| tests/cases/checkstyle/clean/files/mise.toml | Fixture tool pin for Checkstyle |
| tests/cases/checkstyle/clean/files/Foo.java | Java fixture input |
| tests/cases/checkstyle/clean/files/checkstyle.xml | Minimal Checkstyle config fixture |
| src/runner.rs | Add failure_output_patterns support and output scanning helper |
| src/registry/types.rs | Introduce JavaJarMode + failure-output-patterns on Check |
| src/registry/checks.rs | Register the new checkstyle check and its configuration |
| src/main.rs | Update expected linter table output to include Checkstyle |
| src/linters/mod.rs | Generalize JAR spawning to support java -jar (incl. non-Windows) |
| src/init/scaffold.rs | Bump pinned mise version/hash in generated scaffold |
| README.md | Add Checkstyle to the Java linter row in the top-level table |
| mise.toml | Pin Checkstyle and adjust Renovate pin with trust-policy excludes |
| docs/linters/checkstyle.md | New generated linter documentation page |
| docs/linters.md | Add Checkstyle to the linter index table |
| default.json | Add checkstyle to default tool enablement list |
| .github/workflows/test.yml | Bump pinned mise version/hash in CI matrix |
| .github/workflows/release.yml | Bump pinned mise version/hash in release workflow |
| .github/workflows/release-plz.yml | Bump pinned mise version/hash in release-plz workflow |
| .github/workflows/mise-registry.yml | Bump pinned mise version/hash in mise-registry workflow |
| .github/workflows/lint.yml | Bump pinned mise version/hash in lint workflow |
| .github/renovate.json5 | Track Checkstyle in Renovate-managed tool list |
| .github/renovate-tracked-deps.json | Add Checkstyle datasource mapping and tracked tool list entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # .github/workflows/lint.yml # .github/workflows/mise-registry.yml # .github/workflows/release-plz.yml # .github/workflows/release.yml # .github/workflows/test.yml # src/init/scaffold.rs
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
## 🤖 New release * `flint`: 0.22.9 -> 0.22.10 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.22.10](v0.22.9...v0.22.10) - 2026-07-27 ### Added - add safe dotenv linting ([#436](#436)) - add native Java formatting and regex replacements ([#407](#407)) - add scoped Kubernetes manifest linting ([#437](#437)) - add standalone Checkstyle linting ([#435](#435)) - improve Flint init and setup migrations ([#428](#428)) - define registry and execution contracts ([#427](#427)) ### Fixed - *(renovate)* avoid overlapping mise managers ([#446](#446)) ### Other - *(deps)* update dependency jdx/mise-action to v4.2.2 ([#448](#448)) - make Windows aube installs cacheable ([#447](#447)) - *(deps)* update mise to v2026.7.12 ([#444](#444)) - *(deps)* update linters ([#443](#443)) - move linter reference to dedicated pages ([#440](#440)) - *(deps)* lock file maintenance ([#445](#445)) - *(deps)* update taiki-e/install-action action to v2.85.0 ([#442](#442)) - *(deps)* update taiki-e/install-action action to v2.84.1 ([#441](#441)) - require silent happy paths for checks ([#439](#439)) - *(deps)* update grafana/shared-workflows/lint-pr-title action to v1.2.4 ([#438](#438)) - add Linux musl release artifacts ([#421](#421)) - validate curated mise registry backends ([#429](#429)) - *(deps)* update rust crate tokio to v1.53.1 ([#434](#434)) - *(deps)* update taiki-e/install-action action to v2.84.0 ([#433](#433)) - *(deps)* update rust crate clap to v4.6.3 ([#432](#432)) - *(deps)* update rust crate serde_json to v1.0.151 ([#431](#431)) - record Flint v2 architecture decisions ([#426](#426)) - *(deps)* update taiki-e/install-action action to v2.83.4 ([#423](#423)) - *(deps)* update actions/checkout digest to 3d3c42e ([#422](#422)) - *(deps)* update rust crate regex to v1.13.1 ([#412](#412)) - document semantic PR title guidance ([#420](#420)) - *(deps)* update linters ([#418](#418)) - *(deps)* update dependency mise to v2026.7.7 ([#417](#417)) - *(deps)* lock file maintenance ([#419](#419)) - *(deps)* update taiki-e/install-action action to v2.83.3 ([#415](#415)) - *(deps)* update rust crate tokio to v1.52.4 ([#414](#414)) - *(deps)* update dependency jdx/mise-action to v4.2.1 ([#416](#416)) - *(deps)* update dependency rust to v1.97.1 ([#413](#413)) - *(deps)* update rust crate clap to v4.6.2 ([#411](#411)) - *(deps)* update rust crate globset to v0.4.19 ([#410](#410)) - *(deps)* update rust crate toml_edit to v0.25.13 ([#409](#409)) - *(deps)* update rust crate toml to v1.1.3 ([#408](#408)) - document signed commit requirement ([#406](#406)) - batch rumdl file checks ([#404](#404)) - *(deps)* update taiki-e/install-action action to v2.83.2 ([#405](#405)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Blocked by #447
Summary
Split from #430 so the Checkstyle integration can be reviewed independently.
Validation
mise run generatemise run lint:fixmise exec -- cargo test