2022-08-15 15:42:36 +00:00
|
|
|
# pre-commit is a useful tool which can be setup by contributors
|
|
|
|
# per-repository in a few simple steps given that the
|
|
|
|
# repository has a config file like this one.
|
|
|
|
#
|
|
|
|
# The configured hooks are run on `git commit`. If one of the hooks makes or
|
|
|
|
# demands a change of the commits contents the commit process is aborted.
|
|
|
|
# The hooks can also be run manually through `pre-commit run --all-files`.
|
|
|
|
|
|
|
|
minimum_pre_commit_version: "1.15"
|
|
|
|
|
|
|
|
# The following hooks will be run before a commit is created
|
|
|
|
repos:
|
|
|
|
# general stuff
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-02-18 18:10:24 +00:00
|
|
|
rev: v4.4.0
|
2022-08-15 15:42:36 +00:00
|
|
|
hooks:
|
|
|
|
# check file system problems
|
|
|
|
- id: check-case-conflict
|
|
|
|
- id: check-symlinks
|
|
|
|
- id: destroyed-symlinks
|
|
|
|
|
|
|
|
# unify whitespace and line ending
|
|
|
|
- id: trailing-whitespace
|
|
|
|
args: [--markdown-linebreak-ext=md]
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
- id: mixed-line-ending
|
|
|
|
|
|
|
|
# sort requirements.txt files
|
|
|
|
- id: requirements-txt-fixer
|
|
|
|
|
2023-03-21 09:05:11 +00:00
|
|
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
|
|
rev: "v0.0.257"
|
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
args: [--fix, --exit-non-zero-on-fix]
|
|
|
|
|
2022-08-15 15:42:36 +00:00
|
|
|
# format python files
|
|
|
|
- repo: https://github.com/psf/black
|
2023-02-18 18:10:24 +00:00
|
|
|
rev: 22.12.0
|
2022-08-15 15:42:36 +00:00
|
|
|
hooks:
|
|
|
|
- id: black
|
|
|
|
files: ^(src/vorta/|tests)
|
|
|
|
|
|
|
|
# # run black on code embedded in docstrings
|
|
|
|
# - repo: https://github.com/asottile/blacken-docs
|
|
|
|
# rev: v1.12.1
|
|
|
|
# hooks:
|
|
|
|
# - id: blacken-docs
|
|
|
|
# additional_dependencies: [black]
|
|
|
|
# args:
|
|
|
|
# [
|
|
|
|
# --line-length,
|
|
|
|
# "120",
|
|
|
|
# --skip-string-normalization,
|
|
|
|
# --target-version,
|
|
|
|
# py39,
|
|
|
|
# ]
|
|
|
|
|
|
|
|
# check pep8 conformity using flake8
|
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2023-02-18 18:10:24 +00:00
|
|
|
rev: 6.0.0
|
2022-08-15 15:42:36 +00:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
|
|
|
|
# configuration for the pre-commit.ci bot
|
|
|
|
# only relevant when actually using the bot
|
|
|
|
ci:
|
|
|
|
autofix_commit_msg: |
|
|
|
|
[pre-commit.ci] auto fixes from pre-commit.com hooks
|
|
|
|
|
|
|
|
for more information, see https://pre-commit.ci and
|
|
|
|
the `.pre-commit-config.yaml` file in this repository.
|
|
|
|
|
|
|
|
autofix_prs: true # default
|
|
|
|
autoupdate_commit_msg: |
|
|
|
|
[pre-commit.ci] Autoupdate pre-commit hook versions.
|
|
|
|
|
|
|
|
for more information, see https://pre-commit.ci and
|
|
|
|
the `.pre-commit-config.yaml` file in this repository.
|
|
|
|
|
|
|
|
submodules: false # default
|