hi-ml/.pre-commit-config.yaml

58 строки
2.2 KiB
YAML

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# See https://github.com/pre-commit/pre-commit-hooks/blob/master/.pre-commit-config.yaml for an example with more hooks
ci:
autofix_prs: true
autoupdate_commit_msg: "ENH: Autoupdate hooks [pre-commit.ci]"
autoupdate_schedule: monthly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast # Simply check whether the files parse as valid python
- id: check-yaml # Attempts to load all yaml files to verify syntax
- id: check-added-large-files # Prevent giant files from being committed
- id: check-docstring-first # Checks a common error of defining a docstring after code
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: detect-private-key # Detects the presence of private keys
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline
- id: trailing-whitespace # This hook trims trailing whitespace
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable
# The structure of this was suggested by the author of pre-commit and maintainer of flake8
# See https://stackoverflow.com/a/66485642/3956024
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
name: flake8 ./hi-ml/
alias: flake8-hi-ml
files: ^hi-ml/
args: [--config, hi-ml/.flake8]
- id: flake8
name: flake8 ./hi-ml-azure/
alias: flake8-hi-ml-azure
files: ^hi-ml-azure/
args: [--config, hi-ml-azure/.flake8]
- id: flake8
name: flake8 ./hi-ml-cpath/
alias: flake8-hi-ml-cpath
files: ^hi-ml-cpath/
args: [--config, hi-ml-cpath/.flake8]
- id: flake8
name: flake8 ./hi-ml-multimodal/
alias: flake8-hi-ml-multimodal
files: ^hi-ml-multimodal/
args: [--config, hi-ml-multimodal/.flake8]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
extend-exclude: ^docs/source/amulet/amulet_script.py
args: [--line-length, "120", --skip-string-normalization]