Skip to content

Commit f93adf8

Browse files
committed
Add updated pre-commit config.
1 parent e5e9338 commit f93adf8

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
1+
# SPDX-FileCopyrightText: Copyright 2025, 2026 Arm Limited and affiliates.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -8,6 +8,8 @@ repos:
88
- repo: local
99
hooks:
1010
# Python/YAML/shell: use hash comments (no --multi-line)
11+
# This hook mutates copyright metadata, so CI must only run it on changed
12+
# files via --from-ref/--to-ref. Do not run this hook with --all-files.
1113
- id: reuse-annotate-current-year-python-yaml-shell-files
1214
name: REUSE Annotate (Python add current year, merge)
1315
language: python
@@ -28,6 +30,8 @@ repos:
2830
stages: [ pre-commit ]
2931

3032
# JSON/Markdown/welcome.txt: use sidecar .license files
33+
# This hook mutates copyright metadata, so CI must only run it on changed
34+
# files via --from-ref/--to-ref. Do not run this hook with --all-files.
3135
- id: reuse-annotate-current-year-json-and-md
3236
name: REUSE Annotate (JSON/Markdown/welcome.txt sidecar fallback add current year, merge)
3337
language: python
@@ -49,6 +53,8 @@ repos:
4953
- repo: https://github.com/fsfe/reuse-tool
5054
rev: v6.2.0
5155
hooks:
56+
# File-level REUSE validation for changed files. CI also runs `reuse lint`
57+
# across the whole repo because validation is non-mutating.
5258
- id: reuse-lint-file
5359
stages: [ pre-commit ]
5460
name: "REUSE Compliant Copyright and License"
@@ -58,3 +64,36 @@ repos:
5864
hooks:
5965
- id: trailing-whitespace
6066
stages: [ pre-commit ]
67+
- id: end-of-file-fixer
68+
stages: [ pre-commit ]
69+
- id: mixed-line-ending
70+
stages: [ pre-commit ]
71+
# Cheap changed-file guard for accidentally committed conflict markers.
72+
# GitHub detects active merge conflicts, but this also catches conflict
73+
# markers committed into files.
74+
- id: check-merge-conflict
75+
stages: [ pre-commit ]
76+
# Avoid adding paths that collide on case-insensitive filesystems.
77+
- id: check-case-conflict
78+
stages: [ pre-commit ]
79+
# Catch symlinks that point to missing targets. This is normally a no-op
80+
# for this repo, but keeps broken links from entering via future changes.
81+
- id: check-symlinks
82+
stages: [ pre-commit ]
83+
- id: check-json
84+
stages: [ pre-commit ]
85+
- id: check-yaml
86+
stages: [ pre-commit ]
87+
# Only checks newly added files, even when invoked with --all-files.
88+
- id: check-added-large-files
89+
args: [ --maxkb=1024 ]
90+
stages: [ pre-commit ]
91+
# Scoped to PyTorch because the existing TensorFlow tree currently has
92+
# the same classify_image.py executable-bit mismatch.
93+
- id: check-executables-have-shebangs
94+
files: ^ML-Frameworks/pytorch-aarch64/
95+
stages: [ pre-commit ]
96+
# Keep script shebangs and executable bits consistent for runnable files.
97+
- id: check-shebang-scripts-are-executable
98+
files: ^ML-Frameworks/pytorch-aarch64/
99+
stages: [ pre-commit ]

0 commit comments

Comments
 (0)