Closed Bug 1849267 Opened 2 years ago Closed 8 days ago

black errors should be marked as automatically fixable

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Logan, Unassigned)

Details

When you get a lint error from black, it doesn't indicate that it is automatically fixable:

/Users/logan/mozilla-unified/testing/mozharness/scripts/does_it_crash.py
  0   error  Reformat python  (black)

✖ 1 problem (1 error, 0 warnings, 0 fixed)

However if you pass --fix, it automatically fixes the issue:

logan@Logans-MacBook-Air ~/mozilla-unified (default|update-black) [1]> ./mach lint . -l black --fix
✖ 0 problems (0 errors, 1 warning, 1 fixed)

The output should say that it's automatically fixable accordingly.

Neat idea! Maybe when --fix isn't passed, it could say something like:

✖ 1 problem (1 error, 0 warnings, 1 fixable)

The problem is that this would need to work across all linters, and many linters have only a subset of errors that are fixable. They might not expose whether an error is fixable or not ahead of time.

black was replaced by ruff in this codebase; closing accordingly.

Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.