Disable lint checks or provide a command to auto-fix all of them
Categories
(Tree Management :: Treeherder, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: ekyle, Unassigned)
Details
My PRs include hours devoted to lint fixes. Let's provide a way to autofix all lint errors, and disable any lint fixes that can not be auto-fixed.
Passing operational tests should be the only requirement.
Comment 1•6 years ago
•
|
||
I envisioned using pre-commit for the linters since it takes so little time to execute.
Perhaps we can reduce it to "pre-push".
On another note, once we can start an IDE within a venv (thus, all packages being available within the IDE) we can use plugins to fix issues automatically.
This would be part of the GSoC I'm trying to arrange for this summer.
Comment 2•6 years ago
|
||
You can try installing hooks on your local development to give it a try:
http://flake8.pycqa.org/en/latest/user/using-hooks.html
https://github.com/timothycrosley/isort#git-hook
![]() |
Reporter | |
Comment 3•6 years ago
|
||
:armenzg I already run ./runtests.sh
, and it is enough that it is modified so that passing it will mean passing the checks on travis.
- isort should be set to autofix
- some flake8 checks are on travis, but not in the
./runtests.sh
Running the lint fixes as a pre-push hook is too late; the commit has already been done, requiring yet-another-commit with the lint changes. We can still commit with --no-verify
if we want to commit faster.
![]() |
Reporter | |
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Can I work on this issue?
Comment 5•6 years ago
|
||
Kyle, we can use a pre-commit hook instead of pre-push.
Shivansh, could you see if flake8 and isort in runtests.sh can be changed to autofix?
Thanks for your help!
![]() |
Reporter | |
Comment 6•6 years ago
|
||
(In reply to Shivansh Srivastava from comment #4)
Can I work on this issue?
Also, look at the .travis.yml
which runs some number of formatting rules not included in the ./runtests.sh
: There are javascript checks that are running over the python codebase (not fixing python code, rather looking for json files and other web-like files).
Assignee | ||
Updated•4 years ago
|
Description
•