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/.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 a9a8dadc..6410bed6 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 d15ec115..3a3ba749 100644 --- a/tox.ini +++ b/tox.ini @@ -11,8 +11,9 @@ deps = description = Run linters skip_install = true deps = - ruff~=0.1.0 + ruff~=0.4.3 commands = ruff check sksurv/ tests/ setup.py +pass_env = RUFF_* # Documentation [testenv:docs]