From 3227c0cddf520737e3013794da306244ea70986a Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Thu, 18 Sep 2025 15:59:14 +0100 Subject: [PATCH] Remove ruff-increased-checking.toml as all checker are now on! --- .gitlab-ci.yml | 12 ----------- CONTRIBUTING.md | 2 +- pyproject.toml | 4 ---- ruff-increased-checking.toml | 41 ------------------------------------ 4 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 ruff-increased-checking.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0680fe5..a476aa23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,18 +88,6 @@ ruff-checks: - ruff format --check # Only run on changed python files -# Increased checking of the code with ruff this is allowed to fail -# while we improve the code quality. Rules from this are -# slowly moved into the main check -# Only runs when a .py file is edited -ruff-lint-increased: - stage: analysis - extends: .python - allow_failure: true - script: - - ruff --config ruff-increased-checking.toml check - - # Python type checking with Mypy # Only runs when a .py file is edited mypy: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b171d161..a108e8c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ Ideally, python code should be: The server code is going through significant flux during the transition from v2 to v3, so currently our test coverage is being rebuilt and type checking does not yet pass. -[Ruff](https://docs.astral.sh/ruff/) is used both for linting and formatting the codebase. Our custom linter rules are in our `pyproject.toml`. As we improve the codebase, more rules are being added to the linter; see `ruff-increased-checking.toml` for checks that we plan to get passing. +[Ruff](https://docs.astral.sh/ruff/) is used both for linting and formatting the codebase. Our custom linter rules are in our `pyproject.toml`. Run `ruff format` to format the code in a way that will pass on our CI. diff --git a/pyproject.toml b/pyproject.toml index 0e63127d..aae45c65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,10 +100,6 @@ testpaths = ["tests"] line-ending = "native" [tool.ruff.lint] - -# Slowly add linting rules from ruff-increased-checking.toml commented -# out rules can be checked by running -# ruff --config ruff-increased-checking.toml check select = [ "E", # pycodestyle errors "W", #pycodestyle warnings diff --git a/ruff-increased-checking.toml b/ruff-increased-checking.toml deleted file mode 100644 index fd63f8fe..00000000 --- a/ruff-increased-checking.toml +++ /dev/null @@ -1,41 +0,0 @@ -# This can be passed into ruff with nano ruff-increased-checking.toml -# -# Once the codebase is cleaner this can be added to pyproject.toml -# under the [tool.ruff.lint] heading -# -# Select more than the bare minimum checking in ruff -# This is only a subset of possible rules -# See: https://docs.astral.sh/ruff/rules -# -# It will take a long time to get this all passing. We should -# slowly move rules into the pyproject.toml as we improve the -# codebase - -select = [ - "E", # pycodestyle errors - "W", #pycodestyle warnings - "F", # PyFlakes - "PL", # Pylint (a subset of, catches far less than pylint does) - "B", # Flake8 bugbear - "A", # Flake8 builtins checker - "C", # Flake8 comprehensions - "FIX", #TODO/FIXME's in code. These should be added during development for ongoing tasks. - # If they are not fixed before merge they should be converted to GitLab issues - "LOG", # Flake8 logging issues (pedantic logger formatting issues can be added with "G") - "T20", # Warns for print statements, production code should log - "PT", # pytest linting - "RET", # Consistent clear return statements - "RSE", # Raise parentheses - "SIM", # Simplifications detected - "ARG", # unused arguments - "C90", # McCabe complexity! - "NPY", # Numpy linting - "N", # PEP8 naming - "D", # Docstring checks these may need to be added gradually - "ERA001", # Commented out code! -] - -# Line length is set to 88 for ruff. This is what the formatter aims for -# some lines are not formatted to 88 if the formatter can't easily break -# them. Allow up to 99 before throwing a long line error -line-length = 99