# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
  (?x)^(
    3rdparty/ |
    .clang-format$
  )

repos:
# Base
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v3.2.0
  hooks:
    - id: trailing-whitespace
      exclude: |
        (?x)^(
          i18n/|
          vcpkg/
        )
    - id: check-yaml
    - id: check-added-large-files
      args: ['--maxkb=8000']

- repo: local
  hooks:
#  - id: qmllint
#    name: Run qmllint
#    description: QML linter
#    entry: qmllint
#    language: system
#    files: .*\.qml

  - id: shfmt
    name: Run shfmt
    description: shfmt Shell code formatter.
    entry: shfmt -w
    language: system
    types: [file, shell]
    exclude: .docker/android_dev/tools/android-accept-licenses.sh

# Shellcheck
- repo: https://github.com/jumanjihouse/pre-commit-hooks
  rev: 2.1.5
  hooks:
    - id: shellcheck
      args: ['-e', 'SC2016,SC2015,SC2086,SC2002,SC1117,SC2154,SC2076,SC2046,SC1090,SC2038,SC2031,SC2030,SC2162,SC2044,SC2119,SC1001,SC2120,SC2059,SC2128,SC2005,SC2013,SC2027,SC2090,SC2089,SC2124,SC2001,SC2010,SC1072,SC1073,SC1009,SC2166,SC2045,SC2028,SC1091,SC1083,SC2021']
      exclude: android

- repo: https://github.com/ambv/black
  rev: 22.3.0
  hooks:
    - id: black


- repo: https://github.com/cheshirekow/cmake-format-precommit
  rev: v0.6.13
  hooks:
  - id: cmake-format
    additional_dependencies: [pyyaml>=5.1]
    args: [--in-place]
    files: (src|test)/.*/CMakeLists.txt$

- repo: https://github.com/pre-commit/mirrors-clang-format
  rev: v13.0.0
  hooks:
  - id: clang-format
    types_or: [c++, c, c#, java]

- repo: https://github.com/sirosen/check-jsonschema
  rev: 0.8.2
  hooks:
  - id: check-jsonschema
    name: "Check zenodo.json"
    files: .zenodo.json
    types: [json]
    args: ["--schemafile", "https://raw.githubusercontent.com/rouault/zenodo_json_schema/master/zenodo-json-schema.json"]


- repo: https://github.com/nrbnlulu/qt-hooks
  rev: v0.1.5  # current revision
  hooks:
    -  id: qml-format

- repo: https://github.com/open-vcpkg/pre-commit
  rev: v1.0.1
  hooks:
    -  id: vcpkg-format-manifest
