diff options
author | Christian Clauss <cclauss@me.com> | 2023-04-14 18:49:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 16:49:01 +0000 |
commit | 4c2241400a6676898d329be8379116f3ddd6ce75 (patch) | |
tree | 13e1e390c9afcf3dbb379a82dc9db1f628289ef8 /Makefile | |
parent | cad0ae702baedb24344be61be9e87c618a080471 (diff) | |
download | node-new-4c2241400a6676898d329be8379116f3ddd6ce75.tar.gz |
build: replace Python linter flake8 with ruff
PR-URL: https://github.com/nodejs/node/pull/47519
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1489,22 +1489,22 @@ cpplint: lint-cpp $(warning Please use lint-cpp instead of cpplint) .PHONY: lint-py-build -# python -m pip install flake8 +# python -m pip install ruff # Try with '--system' if it fails without; the system may have set '--user' lint-py-build: - $(info Pip installing flake8 linter on $(shell $(PYTHON) --version)...) - $(PYTHON) -m pip install --upgrade -t tools/pip/site-packages flake8 || \ - $(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages flake8 + $(info Pip installing ruff on $(shell $(PYTHON) --version)...) + $(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff || \ + $(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff .PHONY: lint-py -ifneq ("","$(wildcard tools/pip/site-packages/flake8)") -# Lints the Python code with flake8. -# Flag the build if there are Python syntax errors or undefined names +ifneq ("","$(wildcard tools/pip/site-packages/ruff)") +# Lint the Python code with ruff. lint-py: - PYTHONPATH=tools/pip $(PYTHON) -m flake8 --count --show-source --statistics . + tools/pip/site-packages/bin/ruff --version + tools/pip/site-packages/bin/ruff . else lint-py: - $(warning Python linting with flake8 is not available) + $(warning Python linting with ruff is not available) $(warning Run 'make lint-py-build') endif |