From 904957c50f84b800270fa9c78aa1f8d78b18944d Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Tue, 1 Jul 2025 13:37:17 +0200 Subject: [PATCH] Allow --fix in copyright linter wrapper Sometimes doing it manually is cumbersome. Signed-off-by: Ralph Sennhauser --- source/tools/lint/copyright/copyright.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/tools/lint/copyright/copyright.sh b/source/tools/lint/copyright/copyright.sh index a785c20969..3db7fa81f3 100755 --- a/source/tools/lint/copyright/copyright.sh +++ b/source/tools/lint/copyright/copyright.sh @@ -14,6 +14,9 @@ while [ "$#" -gt 0 ]; do git checkout --quiet "${to_commitish}" shift ;; + --fix) + fix=--fix + ;; -j*) ;; *) printf "Unknown option: %s\n\n" "$1" @@ -34,9 +37,10 @@ fi if [ -n "${diff}" ]; then for sha in $(git rev-list "${diff}"); do + # shellcheck disable=SC2086 git diff-tree --no-commit-id --name-status -r "${sha}" | awk '!/^D/{$1=""; printf "%s\0", substr($0,2)}' | - xargs -0 -L100 ./source/tools/lint/copyright/check_copyright_year.py + xargs -0 -L100 ./source/tools/lint/copyright/check_copyright_year.py ${fix} done else echo "WARNING: running copyright linter without base commit, likely not what you want."