From 9470d0f81f7167215d251c35ca8fd90c13d695c4 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Mon, 22 Apr 2024 21:48:08 -0400 Subject: [PATCH] chore: upgrade pre-commit --- .gitignore | 1 + .pre-commit-config.yaml | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ce4e9a5..57e7556 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__/ # C extensions *.so + # Distribution / packaging .Python build/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbe6613..8254c91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,14 @@ +ci: + autoupdate_commit_msg: "chore: update pre-commit hooks" + autofix_commit_msg: "style: pre-commit fixes" + autoupdate_schedule: quarterly + repos: - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0" hooks: - id: blacken-docs - additional_dependencies: [black==23.*] + additional_dependencies: [black] - repo: https://github.com/sondrelg/pep585-upgrade rev: "v1.0" @@ -137,12 +142,24 @@ repos: rev: 0.7.1 hooks: - id: nbstripout + - repo: https://github.com/MarcoGorelli/auto-walrus rev: 0.3.3 hooks: - id: auto-walrus - - repo: https://github.com/shssoichiro/oxipng - rev: v9.1.0 + # uncomment locally if needed, currently needs rust version not available on pre-commit.ci + # - repo: https://github.com/shssoichiro/oxipng + # rev: v9.1.0 + # hooks: + # - id: oxipng + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.1" hooks: - - id: oxipng + - id: ruff + types_or: [python, pyi, jupyter] + args: [--fix, --unsafe-fixes, --show-fixes] + # Run the formatter. + - id: ruff-format + types_or: [python, pyi, jupyter] \ No newline at end of file