# SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

default_stages:
  - merge-commit
  - commit
  - post-rewrite

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.3.0
  hooks:
  - id: check-merge-conflict
  - id: trailing-whitespace
  - id: end-of-file-fixer
  - id: mixed-line-ending
    args: ['--fix=lf']
  - id: check-executables-have-shebangs
  - id: check-shebang-scripts-are-executable
  - id: detect-private-key
  - id: check-added-large-files
  - id: check-case-conflict
  - id: destroyed-symlinks
  - id: check-yaml
    exclude: '.clang-format'

- repo: https://github.com/detailyang/pre-commit-shell
  rev: 1.0.5
  hooks:
  - id: shell-lint
    args: ['-x', '--severity=warning']

- repo: https://github.com/pre-commit/mirrors-clang-format
  rev: v14.0.6
  hooks:
  - id: clang-format

- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
  rev: v0.1.0
  hooks:
  - id: dockerfilelint

- repo: https://github.com/psf/black
  rev: 22.10.0
  hooks:
  - id: black

- repo: https://github.com/pycqa/flake8
  rev: 5.0.4
  hooks:
  - id: flake8
    args:
      - "--max-line-length=110"
