From bddfc5f8818c558707bda17b49f3702a88954c13 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 16 Oct 2025 15:04:39 +0200 Subject: [PATCH 1/2] Add configuration for Ruff and Cython linting in pyproject.toml --- pyproject.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4849f0b5..f5c5a4b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,15 @@ [build-system] requires = ["setuptools>=62.3", "oldest-supported-numpy", "cython~=3.0", "raysect==0.8.1.*"] build-backend="setuptools.build_meta" + +[tool.ruff] +line-length = 120 +include = ["cherab/**/*.py", "demos/**/*.py"] + +[tool.ruff.lint] +ignore = [ + "F401", # ignore unused imports +] + +[tool.cython-lint] +max-line-length = 140 From 463de87ec712058863a913b067afc7a9fef6cfa9 Mon Sep 17 00:00:00 2001 From: Koyo MUNECHIKA <51052381+munechika-koyo@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:19:54 +0900 Subject: [PATCH 2/2] Update pyproject.toml with ruff linting settings Added new linting rules and configuration for ruff. Use ruff's rules for docstring lint --- pyproject.toml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f5c5a4b6..fca4607b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,9 +7,30 @@ line-length = 120 include = ["cherab/**/*.py", "demos/**/*.py"] [tool.ruff.lint] +select = [ + "E", # pycodestyle + "B", # flake8-bugbear + "F", # pyflakes + "I", # isort (import order) + "N", # pep8-naming + "W", # Warning + "UP", # pyupgrade + "NPY", # numpy specific rules + "D", # pydocstyle + "DOC", # pydoclint +] +preview = true ignore = [ - "F401", # ignore unused imports + # Recommended ignores by ruff when using formatter + "E501", # line too long + "N803", # argument name should be lowercase + "N806", # variable in function should be lowercase + "D107", # missing docstring in __init__ + "F401", # ignore unused imports ] +[tool.ruff.lint.pydocstyle] +convention = "numpy" + [tool.cython-lint] max-line-length = 140