From ae727e9dc9e4ec47443920327f1984440566abce Mon Sep 17 00:00:00 2001 From: rht Date: Sat, 29 Jun 2024 21:53:06 -0400 Subject: [PATCH] ci: Add pre-commit configuration --- .codespellignore | 2 ++ .pre-commit-config.yaml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .codespellignore create mode 100644 .pre-commit-config.yaml diff --git a/.codespellignore b/.codespellignore new file mode 100644 index 00000000..ed64b98e --- /dev/null +++ b/.codespellignore @@ -0,0 +1,2 @@ +nd +wasn diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..c9d08c56 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +ci: + autoupdate_schedule: 'monthly' + +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.4.3 + hooks: + # Run the linter. + - id: ruff + types_or: [ python, pyi, jupyter ] + args: [ --fix ] + # Run the formatter. + - id: ruff-format + types_or: [ python, pyi, jupyter ] +- repo: https://github.com/asottile/pyupgrade + rev: v3.15.2 + 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/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + args: [ + "--ignore-words", + ".codespellignore", + "--exclude-file", + "docs/api/search.js", + ]