# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.3.0
  hooks:
  - id: check-added-large-files
  - id: fix-byte-order-marker
  - id: check-case-conflict
  - id: check-executables-have-shebangs
  - id: check-json
  - id: check-merge-conflict
  - id: check-shebang-scripts-are-executable
  - id: check-symlinks
  - id: check-yaml
  - id: destroyed-symlinks
  - id: end-of-file-fixer
  - id: mixed-line-ending
  - id: pretty-format-json
    args:
      - "--autofix"
      - "--indent=2"
      - "--no-ensure-ascii"
      - "--no-sort-keys"
  - id: trailing-whitespace
- repo: https://github.com/sirosen/texthooks
  rev: 0.4.0
  hooks:
  - id: forbid-bidi-controls
- repo: https://github.com/pre-commit/mirrors-clang-format
  rev: v20.1.8
  hooks:
  - id: clang-format
    types_or: [c++, c]
- repo: local
  hooks:
    - id: include_tango_h
      name: Check that tango/tango.h is not included in source code
      types_or: [c++, c]
      exclude: 'tests/'
      args: [--multiline]
      entry: "#include <tango/tango.h>"
      language: pygrep
- repo: local
  hooks:
    - id: check_unsafe_number_parsing
      name: Check that no unsafe string number conversion routines are used
      types_or: [c++, c]
      exclude: '(src/common/parse\.cpp)'
      args: [--multiline]
      entry: "(ato(i|l|ll|f)|strto(l|ll|ul|ull|f|d|ld)|strtoimax|strtoumax|sto(i|l|ll))"
      language: pygrep
- repo: local
  hooks:
    - id: check-header-guard
      name: Check that the header guard is expected for each header file
      entry: ./ci/check-header-guard.sh
      exclude: '(tests/cxxtest/.*\.h)|(src/client/doc\.h)'
      language: script
      files: (\.h(\.in)?)$

- repo: https://github.com/espressif/check-copyright/
  rev: v1.1.1
  hooks:
    - id: check-copyright
      args: ['--config', 'ci/check_copyright_config.yaml']
