summaryrefslogtreecommitdiff
path: root/pyproject.toml
diff options
context:
space:
mode:
authorChristian Clauss <cclauss@me.com>2023-04-14 18:49:01 +0200
committerGitHub <noreply@github.com>2023-04-14 16:49:01 +0000
commit4c2241400a6676898d329be8379116f3ddd6ce75 (patch)
tree13e1e390c9afcf3dbb379a82dc9db1f628289ef8 /pyproject.toml
parentcad0ae702baedb24344be61be9e87c618a080471 (diff)
downloadnode-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 'pyproject.toml')
-rw-r--r--pyproject.toml48
1 files changed, 48 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000000..6b51197ad6
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,48 @@
+[tool.ruff]
+select = [
+ "C90", # McCabe cyclomatic complexity
+ "E", # pycodestyle
+ "F", # Pyflakes
+ "ICN", # flake8-import-conventions
+ "INT", # flake8-gettext
+ "PLC", # Pylint conventions
+ "PLE", # Pylint errors
+ "PLR09", # Pylint refactoring: max-args, max-branches, max returns, max-statements
+ "PYI", # flake8-pyi
+ "RSE", # flake8-raise
+ "RUF", # Ruff-specific rules
+ "T10", # flake8-debugger
+ "TCH", # flake8-type-checking
+ "TID", # flake8-tidy-imports
+ "W", # pycodestyle
+ "YTT", # flake8-2020
+]
+exclude = [
+ "deps",
+ "tools/inspector_protocol",
+]
+ignore = [
+ "E401",
+ "E402",
+ "E7",
+ "PLC1901",
+ "RUF005",
+ "RUF100",
+]
+line-length = 172
+target-version = "py37"
+
+[tool.ruff.mccabe]
+max-complexity = 100
+
+[tool.ruff.per-file-ignores]
+"tools/checkimports.py" = ["W605"]
+"tools/gyp/pylib/gyp/xcodeproj_file.py" = ["PLE0101"]
+"tools/icu/shrink-icu-src.py" = ["W605"]
+"tools/mkssldef.py" = ["W605"]
+
+[tool.ruff.pylint]
+max-args = 12
+max-branches = 110
+max-returns = 12
+max-statements = 289