Open Bug 1611152 Opened 5 years ago Updated 2 years ago

|mach lint -l flake8 --fix| should only fix the errors the linter complains about

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P3)

Tracking

(Not tracked)

People

(Reporter: ahal, Unassigned)

References

Details

Our "fixer" for flake8 is very crude. We simply run the entire file that has flake8 warnings through the autopep8 module. This means it can make changes that are completely irrelevant to the issue that flake8 found.

We should try and ensure we only fix the issues that the linter raises. It looks like autopep8==1.5 has a few new flags that can help us. Namely:

  • --select - Only fixes these specific errors
  • --line-range <begin> <end> - Only fix errors inside this line range

Unsure if the latter can be passed in multiple times or not. If not, we'd need to run autopep8 once per issue.

Priority: -- → P3
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.