Newer
Older
repos:
# Common Pre-commit hooks https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer # adds empty line to the end of files
- id: trailing-whitespace # removes any trailing whitespace
# Black formatter https://black.readthedocs.io/en/stable/
- repo: https://github.com/psf/black
args: ["--line-length", "120", "--target-version", "py38"]
# Commented out until static analysis report is generated
# Pylint https://pylint.pycqa.org/en/latest/
# - repo: https://github.com/pycqa/pylint
# rev: v2.11.1
# hooks:
# - id: pylint
# verbose: true
# args:
# - --max-line-length=120
# - --fail-under=9
# isort https://pycqa.github.io/isort/
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
# --treat-all-comment-as-code: Don't move comments around; avoids the problem of moving pylint ignore
# below imports
args: ["--profile", "black", "--treat-all-comment-as-code", "--filter-files"]
# Skywalking-eyes License header tool https://github.com/apache/skywalking-eyes
- repo: local
hooks:
- id: license-checker
name: license-checker
language: docker_image
entry: --rm apache/skywalking-eyes:0.2.0 --verbosity info --config .licenserc.yaml header check
types_or: [python, ts, shell]
exclude_types: [directory, wsgi]