aspect-build / aspect-build/rules_lint

[Bug]: treat failure to run the linter differently from linter reporting violations

Open
#305 3 comments 1 reaction 0 assignees View on GitHub
bug help wanted
Dominant language
Starlark
Stars
154
Forks
125
Avg merge
3d 21h
Merged PRs (30d)
20

Description

### What happened?

We put the exit code of the linter into a file, and treat that as success.

However https://eslint.org/docs/latest/use/command-line-interface#exit-codes for example shows that a linter can distinguish between an error-level violation of a lint rule, and an error that prevents the linter from running. For example, a missing `dep` on an `js_library(srcs = eslint.rc.cjs)` target will make a successful lint action, with exit code 2 and no report. The tool that interprets the data doesn't have much to go on, as the error was printed to stderr the first time the tool ran, and isn't repeated in a cache hit nor captured in the report file.

### Version

HEAD

### How to reproduce

_No response_

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the linter exit code is written to the file and how the cached report is interpreted, using the js_library target with eslint.rc.cjs as the reproduction context. Compare ESLint's violation and execution-failure exit codes, including the stderr behavior on the first run. Done means lint violations remain reportable while failures to run are preserved and distinguished on cache hits.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.