From 5688c4117b75fdf7577d1a8a153de72a5c2a6420 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Wed, 7 Aug 2024 17:39:07 +0100 Subject: [PATCH] ci: update pre-commit hooks and pyproject ruff config --- .pre-commit-config.yaml | 23 ++++++++++------------- pyproject.toml | 8 ++++---- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fba9315..9ceb14f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,35 +1,32 @@ repos: # Versioning: Commit messages & changelog - repo: https://github.com/commitizen-tools/commitizen - rev: v3.13.0 + rev: v3.28.0 hooks: - id: commitizen stages: [commit-msg] - # Autoformat: Python code - - repo: https://github.com/psf/black - rev: 23.11.0 - hooks: - - id: black - # Lint / autoformat: Python code - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: "v0.1.6" + rev: "v0.5.6" hooks: + # Run the linter - id: ruff - args: [--exit-non-zero-on-fix] + args: [--fix, --exit-non-zero-on-fix] + # Run the formatter + - id: ruff-format # Autoformat: YAML, JSON, Markdown, etc. - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + - repo: https://github.com/pycontribs/mirrors-prettier + rev: v3.3.3 hooks: - id: prettier - args: [--ignore-unknown, --no-error-on-unmatched-pattern, "!chart/**"] + args: [--ignore-unknown, --no-error-on-unmatched-pattern] # Lint: Markdown - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.37.0 + rev: v0.41.0 hooks: - id: markdownlint args: [--fix, --ignore, CHANGELOG.md] diff --git a/pyproject.toml b/pyproject.toml index dd18a7b..8734ffd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,9 +74,7 @@ target-versions = ["py39", "py310", "py311"] [tool.ruff] fix = true line-length = 132 -target-version = "py310" -select = ["I", "E", "W", "D", "B", "F", "N", "Q"] -ignore = ["N805", "B008"] +target-version = "py39" exclude = [ ".git", ".ruff_cache", @@ -86,5 +84,7 @@ exclude = [ "dist", "osm_login_python/__version__.py", ] -[tool.ruff.pydocstyle] +[tool.ruff.lint] +select = ["I", "E", "W", "D", "B", "F", "N", "Q"] +[tool.ruff.lint.pydocstyle] convention = "google"