Makefile: Add lint-python which uses flake8#21952
Conversation
|
Is it not possible to bundle the linting library instead, like we do for eslint? That way we don't need to make system-wide changes (e.g. implicitly upgrading pip)? |
|
We could remove pip install —upgrade pip. |
|
@mscdex Does that last commit cover what you wanted or did I misunderstand your request? Is the automated testing actually doing a "make lint"? If so, how do I view the output? https://github.com/nodejs/node/runs/8932739 does not seem to contain the words "lint-python" or "flake8". |
Makefile
Outdated
There was a problem hiding this comment.
This doesn't work on my system when not run as root:
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/enum34-1.1.6.dist-info'
make[1]: *** [Makefile:1212: lint-python] Error 2
There was a problem hiding this comment.
Can you please try to add --user to the command and let me know if that works?
|
Exclusions don't seem to work. I see many errors coming from |
|
You see these errors where? Locally or in server-based build log? |
|
Locally, with |
|
/cc @nodejs/python @nodejs/build-files |
refack
left a comment
There was a problem hiding this comment.
- Should split build code to a
lint-python-buildtarget, and add conditions (maypeif $(shell python -m flake8 --version) - remove
@for traceability - IMHO setting should go into
tox.iniand not stored in the Makefile
|
Hello @cclauss and thank you for the contribution 🥇 |
|
I implemented all suggestions except:
|
Makefile
Outdated
There was a problem hiding this comment.
lint-python: lint-python-build?
What I meant was include the 'flake8' module in the repo, like we do with eslint for js files, to avoid having to install it system/user-wide (which I would find to be unexpected behavior). |
|
What's the status on this one? |
a4f0ae4 to
4458162
Compare
|
That is lots of approval... https://blog.github.com/2018-10-21-october21-incident-report |
|
@nodejs/build-files @nodejs/python PTAL |
4458162 to
a1b6029
Compare
a1b6029 to
604890b
Compare
604890b to
9a690c3
Compare
PR-URL: nodejs#21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
9a690c3 to
0c39290
Compare
PR-URL: #21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #21952 Reviewed-By: Refael Ackermann <refack@gmail.com>
Add a lint-python section to Makefile which pip installs flake8 and then executes:
Based on the experimentation done at https://travis-ci.com/nodejs/node/builds/79706150 - #21942
These tests currently exclude several directories and files:
Hopefully this list can be reduced in future PRs with code modifications or the use of # noqa
E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
namenamein__all__namereferenced before assignmentChecklist
make -j4 test(UNIX), orvcbuild test(Windows) passes