From 3ca25900d6b2a60cb33db492fda096dde0bf2c60 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sun, 1 Sep 2024 10:37:45 +0200 Subject: [PATCH] pre-commit: Add --fix argument to Ruff Add --fix argument to Ruff in the pre-commit configuration. This allows automatically fixing safe issues (not it's not --unsafe-fixes). --- .pre-commit-config.yaml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d70c163..dd60a049 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,22 +5,23 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.6 + rev: v0.6.3 hooks: - # Run the linter. + # Run the linter with fix argument. - id: ruff types_or: [ python, pyi, jupyter ] + args: [--fix] # This will enable automatic fixing of lint issues where possible. # Run the formatter. - id: ruff-format types_or: [ python, pyi, jupyter ] -- repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 - hooks: - - id: pyupgrade - args: [--py310-plus] -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 # Use the ref you want to point at - hooks: - - id: trailing-whitespace - - id: check-toml - - id: check-yaml +- repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: [--py310-plus] +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 # Use the ref you want to point at + hooks: + - id: trailing-whitespace + - id: check-toml + - id: check-yaml