# pre-commit hook which runs all the various lint checks + black auto formatting on the added
# files.
# This hook relies on development virtual environment being present in virtualenv/.
default_language_version:
  python: python3.6

exclude: '(build|dist)'
repos:
  - repo: local
    hooks:
    - id: black
      name: black
      entry: ./virtualenv/bin/python -m black --config pyproject.toml
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: flake8
      name: flake8
      entry: ./virtualenv/bin/python -m flake8 --config lint-configs/python/.flake8
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: pylint
      name: pylint
      entry: ./virtualenv/bin/python -m pylint -E --rcfile=./lint-configs/python/.pylintrc
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: bandit
      name: bandit
      entry: ./virtualenv/bin/python -m bandit -lll -x build,dist
      language: script
      types: [file, python]
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.5.0
    hooks:
    - id: trailing-whitespace
    - id: check-yaml
      exclude: (openapi\.yaml)

# pre-commit hook which runs all the various lint checks + black auto formatting on the added
# files.
# This hook relies on development virtual environment being present in virtualenv/.
default_language_version:
  python: python3.6

exclude: '(build|dist)'
repos:
  - repo: local
    hooks:
    - id: black
      name: black
      entry: ./virtualenv/bin/python -m black --config pyproject.toml
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: flake8
      name: flake8
      entry: ./virtualenv/bin/python -m flake8 --config lint-configs/python/.flake8
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: pylint
      name: pylint
      entry: ./virtualenv/bin/python -m pylint -E --rcfile=./lint-configs/python/.pylintrc
      language: script
      types: [file, python]
  - repo: local
    hooks:
    - id: bandit
      name: bandit
      entry: ./virtualenv/bin/python -m bandit -lll -x build,dist
      language: script
      types: [file, python]
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.5.0
    hooks:
    - id: trailing-whitespace
      exclude: (^st2common/st2common/openapi.yaml|^st2client/tests/fixtures|^st2tests/st2tests/fixtures)
    - id: check-yaml

Exclude test fixture files from trailing whitespace hook since it breaks some tests.
Exclude test fixture files from trailing whitespace hook since it breaks
some tests.
