# Pre-commit (https://pre-commit.com) configuration for assorted lint checks. # # See https://pre-commit.com/hooks.html for more hooks. # Top level exclusions from all hooks. Some of these could be moved into more # specific exclusions like check-yaml and clang-format, but for large generated # files even simple hooks like trailing-whitespace can be expensive. # # Note the yaml multiline literal and (?x) regex flag used here, see # https://pre-commit.com/#regular-expressions. exclude: | (?x) # ========================================================================== # Opted-out projects # To opt-in, remove your project from the exclusions. # See CONTRIBUTING.md for detailed instructions. # ========================================================================== projects/composablekernel/.*| projects/hipblas/.*| projects/hipblaslt/.*| projects/hipblas-common/.*| projects/hipcub/.*| projects/hipfft/.*| projects/hiprand/.*| projects/hipsolver/.*| projects/hipsparse/.*| projects/hipsparselt/.*| projects/hiptensor/.*| projects/rocblas/.*| projects/rocfft/.*| projects/rocprim/.*| projects/rocsolver/.*| projects/rocsparse/.*| projects/rocthrust/.*| projects/rocwmma/.*| shared/mxdatagenerator/.*| shared/origami/.*| shared/rocroller/.*| shared/tensile/.*| # ========================================================================== # Permanent exclusions # ========================================================================== # Auto-generated GitHub Agentic Workflow lock files \.github/workflows/.*\.lock\.yml$| # Binary files projects/hipdnn/.*\.bin$| # Generated hipDNN FlatBuffers headers projects/hipdnn/flatbuffers_sdk/include/hipdnn_flatbuffers_sdk/data_objects/.*_generated\.h| # Reference data (auto-generated) dnn-providers/integration-tests/integration_test_bundles/.*| # Generated files (see rocrand/tools/ _generator.cpp files) projects/rocrand/library/.*constants\.(cpp|h)| projects/rocrand/library/.*precomputed\.(cpp|h)| # MIOpen exclusion list projects/miopen/.*\.s$| projects/miopen/.*\.inc$| projects/miopen/.*\.model$| # RPP exclusion list projects/rpp/utilities/test_suite/TEST_IMAGES/three_images_yuv/.*| projects/rpp/utilities/test_suite/REFERENCE_OUTPUT/yuv_to_rgb/.*| projects/rpp/utilities/test_suite/REFERENCE_OUTPUT/yuv_to_rgb_cubic_v/.*| projects/rpp/utilities/test_suite/REFERENCE_OUTPUT/yuv_to_rgb-linear_v/.* repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml exclude: | (?x) ^projects/hipdnn/\.clang-format$| ^projects/miopen/\.clang-format$| ^dnn-providers/miopen-provider/\.clang-format$| ^dnn-providers/hipblaslt-provider/\.clang-format$| ^dnn-providers/hip-kernel-provider/\.clang-format$| ^dnn-providers/integration-tests/\.clang-format$ - id: check-added-large-files - repo: https://github.com/psf/black rev: 25.12.0 hooks: - id: black language_version: python3 - repo: https://github.com/pre-commit/mirrors-clang-format rev: v18.1.4 hooks: - id: clang-format name: clang-format (C/C++/ObjC) entry: clang-format -i -style=file files: '\.(c|cpp|cc|h|hpp|m|mm|cl)$|\.(h|hpp|cpp)\.in$' - repo: local hooks: - id: flatc-hipdnn name: flatc (hipDNN) entry: python projects/hipdnn/scripts/run_flatc.py language: python files: ^projects/hipdnn/(data_sdk|flatbuffers_sdk)/schemas/.*\.fbs$ pass_filenames: true - id: gtest-format-miopen name: GTest naming conventions (MIOpen) entry: python projects/miopen/test/utils/gtest_formating_checks.py language: python files: ^projects/miopen/test/gtest/.*\.cpp$ pass_filenames: false - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.10 hooks: - id: cmake-lint # MIOpen CMake files have not been audited for cmake-lint compliance yet. exclude: ^projects/miopen/.* # cmake-format is disabled due to undesirable formatting. # We can investigate changing the configuration before re-enabling or using an alternative tool. # - id: cmake-format