diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0e07333 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,59 @@ +# pre-commit is a tool to perform a predefined set of tasks manually and/or +# automatically before git commits are made. +# +# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level +# +# Common tasks +# +# - Run on all files: pre-commit run --all-files +# - Register git hooks: pre-commit install --install-hooks +# +repos: + # Autoformat: markdown, yaml + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 # Don't upgrade, v4 causes "No files matching [...]" issues + hooks: + - id: prettier + + # Autoformat: Python code, syntax patterns are modernized + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: + - --py36-plus + + # Autoformat: Python code + - repo: https://github.com/pycqa/isort + rev: "5.13.2" + hooks: + - id: isort + + # Autoformat: Python code + - repo: https://github.com/psf/black + rev: "24.8.0" + hooks: + - id: black + + # Lint: Python code + - repo: https://github.com/pycqa/flake8 + rev: "7.1.1" + hooks: + - id: flake8 + args: + - --max-line-length=88 + + # Prevent known typos from being committed + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: + # Autofix known typos + - --write-changes + additional_dependencies: + - tomli + +# pre-commit.ci config reference: https://pre-commit.ci/#configuration +ci: + autoupdate_schedule: monthly diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..7cc08fe --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# Helm chart's templates aren't pure YAML files +**/templates/