Skip to content

feat(lint): add npm-groovy-lint support for Groovy files#761

Open
TimotheusBachinger wants to merge 2 commits into
aspect-build:mainfrom
TimotheusBachinger:feat/groovy-lint
Open

feat(lint): add npm-groovy-lint support for Groovy files#761
TimotheusBachinger wants to merge 2 commits into
aspect-build:mainfrom
TimotheusBachinger:feat/groovy-lint

Conversation

@TimotheusBachinger

Copy link
Copy Markdown
Contributor

feat(lint): add npm-groovy-lint support for Groovy files

Add a new linter aspect for Groovy files using npm-groovy-lint.

Features:

  • Supports both lint and fix modes
  • Human-readable output (txt format) for console
  • Machine-readable output (SARIF format) for CI integration
  • Works with filegroups tagged with "groovy" or "lint-with-groovy"
  • Integrates with rules_js for npm package management

Demo for using the linter for groovy:
```
$ bazel run //tools/lint:groovy-lint -- `pwd`/src                                                                                                                                                                                                                                                                                                                                                                        130 ↵
INFO: Analyzed target //tools/lint:groovy-lint (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tools/lint:groovy-lint up-to-date:
  bazel-bin/tools/lint/groovy-lint_/groovy-lint
INFO: Elapsed time: 0.080s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/tools/lint/groovy-lint_/groovy-lint <args omitted>
/home/timotheus/git_external/rules_lint/examples/groovy/src/has_errors.groovy
  6     error    The [org.jenkinsci.plugins.pipeline.modeldefinition.Utils] import is never referenced  UnusedImport
  16    error    The variable [unusedVar] in class HasErrors is not used  UnusedVariable

npm-groovy-lint results in 2 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity  │ Total found │
├─────────┼───────────┼─────────────┤
│ 0       │ 'Error'   │ 2           │
│ 1       │ 'Warning' │ 0           │
│ 2       │ 'Info'    │ 0           │
└─────────┴───────────┴─────────────┘
Failure: 2 error(s) have been found
 0 warning(s) have been found
 0 info(s) have been found
```
Add a new linter aspect for Groovy files using npm-groovy-lint.

Features:
- Supports both lint and fix modes
- Human-readable output (txt format) for console
- Machine-readable output (SARIF format) for CI integration
- Works with filegroups tagged with "groovy" or "lint-with-groovy"
- Integrates with rules_js for npm package management
@CLAassistant

CLAassistant commented Feb 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@aspect-workflows

aspect-workflows Bot commented Feb 11, 2026

Copy link
Copy Markdown

Bazel 7 (Test)

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.


Bazel 8 (Test)

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.


Bazel 9 (Test)

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.

@TimotheusBachinger TimotheusBachinger changed the title Add npm-groovy-lint to rules_lint feat(lint): add npm-groovy-lint support for Groovy files Feb 11, 2026
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.

2 participants