aspect-build / aspect-cli

correct, fast, usable: choose three
https://aspect.build/cli
Apache License 2.0
93 stars 22 forks source link

[Bug]: lint --fix doesn't exit with code matching the tool #705

Closed alexeagle closed 4 months ago

alexeagle commented 6 months ago

What happened?

eslint exits 1 if there are errors it's unable to auto-fix, but aspect lint --fix exits zero.

Version

HEAD

How to reproduce

No response

Any other information?

No response

alexeagle commented 4 months ago

I believe this is fixed now, not sure which commit it was:

example % aspect lint --fix src:ts
WARNING: Build options --@@aspect_rules_lint~//lint:debug and --@@aspect_rules_lint~//lint:fix have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //src:ts (1 packages loaded, 9401 targets configured).
INFO: Found 1 target...
Aspect //tools/lint:linters.bzl%eslint of //src:ts up-to-date:
  bazel-bin/src/ts.AspectRulesLintESLint.patch
  bazel-bin/src/ts.AspectRulesLintESLint.report
  bazel-bin/src/ts.AspectRulesLintESLint.report.exit_code
INFO: Elapsed time: 2.024s, Critical Path: 1.67s
INFO: 4 processes: 3 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 4 total actions
Lint results for //src:ts:

src/file.ts: line 2, col 7, Error - Type string trivially inferred from a string literal, remove type annotation. (@typescript-eslint/no-inferrable-types)
src/file.ts: line 7, col 1, Error - Unnecessary try/catch wrapper. (no-useless-catch)

2 problems

Some problems have automated fixes available:

  src/file.ts | 1 !
  1 file, 1 modification(!)

Patched src/file.ts

alexeagle@aspect-build example % echo $?
1
alexeagle@aspect-build example % aspect version
Aspect CLI version: 5.9.36