# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.

default_language_version:
  python: python3

ci:
  autofix_prs: true
  autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
  autoupdate_schedule: quarterly
  submodules: false
  skip: []

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: check-merge-conflict
      - id: check-added-large-files
      - id: end-of-file-fixer
        files: .*.(c|cc|cxx|cpp|cu|cuh|h|hpp|py)$
      - id: trailing-whitespace
        files: .*.(c|cc|cxx|cpp|cu|cuh|h|hpp|py)$

  - repo: https://github.com/psf/black
    rev: 24.4.2
    hooks:
      - id: black
        name: Format python code
        args: [--line-length=100, --preview, --enable-unstable-feature=string_processing]
        types: [python]

  - repo: https://github.com/pre-commit/mirrors-clang-format
    rev: v18.1.6
    hooks:
      - id: clang-format
        entry: clang-format -i
        args: ["-style=file"]
        files: ^transformer_engine.*\.(c|cc|cxx|cpp|cu|cuh|h|hpp)$

  - repo: https://github.com/netromdk/vermin
    rev: c75aca72f4e85c6e47252139e8695f1c8b5f9ae3
    hooks:
      - id: vermin
        args: ['-t=3.10', '--violations']
