From 89fac00c1739566126d66e8ab3973c1224602335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20P=C3=B6lsterl?= Date: Sat, 4 May 2024 23:29:21 +0200 Subject: [PATCH 1/2] CI: Upgrade to ruff 0.4.3 --- .pre-commit-config.yaml | 10 +++++----- pyproject.toml | 12 +++++++----- tox.ini | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9732eee5..3406db50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace exclude: '^\.gitignore$' @@ -26,23 +26,23 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 + rev: 0.28.2 hooks: - id: check-dependabot - id: check-github-workflows - id: check-readthedocs - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 + rev: v1.5.5 hooks: - id: forbid-crlf exclude: '^\.gitignore$' - id: forbid-tabs types: [python] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.4.2 hooks: - id: black-jupyter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.4.3 hooks: - id: ruff diff --git a/pyproject.toml b/pyproject.toml index a6a8adc6..230b1ae2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -178,9 +178,12 @@ extend-exclude = [ ] # Group violations by containing file. output-format = "grouped" +line-length = 120 +target-version = "py39" + +[tool.ruff.lint] ignore = ["C408"] ignore-init-module-imports = true -line-length = 120 select = [ "C4", "C9", @@ -190,15 +193,14 @@ select = [ "PT", "W", ] -target-version = "py39" -[tool.ruff.flake8-pytest-style] +[tool.ruff.lint.flake8-pytest-style] parametrize-names-type = "csv" -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 10 -[tool.ruff.isort] +[tool.ruff.lint.isort] force-sort-within-sections = true known-first-party = ["sksurv"] diff --git a/tox.ini b/tox.ini index 87ab6d7a..b6222785 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ deps = description = Run linters skip_install = true deps = - ruff~=0.1.0 + ruff~=0.4.3 commands = ruff check sksurv/ tests/ setup.py # Documentation From fdce16df3acd27d38da84607370f5736f188d01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20P=C3=B6lsterl?= Date: Sat, 4 May 2024 23:50:40 +0200 Subject: [PATCH 2/2] CI: Use github output format for ruff --- .github/workflows/tox-workflow.yaml | 2 ++ tox.ini | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/tox-workflow.yaml b/.github/workflows/tox-workflow.yaml index a2ac22a4..d35b9b64 100644 --- a/.github/workflows/tox-workflow.yaml +++ b/.github/workflows/tox-workflow.yaml @@ -22,6 +22,8 @@ jobs: - name: Install Tox run: python -m pip install tox - name: Run Tox + env: + RUFF_OUTPUT_FORMAT: github run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" tox run -e ${{ matrix.tox_env }} diff --git a/tox.ini b/tox.ini index b6222785..3e992f48 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ skip_install = true deps = ruff~=0.4.3 commands = ruff check sksurv/ tests/ setup.py +pass_env = RUFF_* # Documentation [testenv:docs]