# 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.8

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: (^conf/|^st2common/st2common/openapi.yaml|^st2client/tests/fixtures|^st2tests/st2tests/fixtures)
    - id: check-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:
  # We don't specify a specific version so it uses either Python 3.6 / Python
  # 3.8 depending on what is available locally and on the runner
  python: python

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: (^conf/|^st2common/st2common/openapi.yaml|^st2client/tests/fixtures|^st2tests/st2tests/fixtures)
    - id: check-yaml

Make pre-commit hook Python version agnostic.
Make pre-commit hook Python version agnostic.
