We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 762d108 commit ed33ae1Copy full SHA for ed33ae1
.pre-commit-config.yaml
@@ -57,3 +57,8 @@ repos:
57
- -tags=nok8s,ptf
58
stages:
59
- pre-push
60
+ - id: copyright-year
61
+ name: Copyright year is up to date in changed files
62
+ entry: ./update-copyright-year.sh
63
+ language: script
64
+ require_serial: true
update-copyright-year.sh
@@ -0,0 +1,14 @@
1
+#!/bin/sh
2
+#
3
+# SPDX-FileCopyrightText: 2025 SUSE LLC
4
5
+# SPDX-License-Identifier: Apache-2.0
6
+
7
+current_year=$(date +%Y)
8
+for changed_file in $@; do
9
+ sed -i -E "s/\/\/ SPDX-FileCopyrightText: [0-9]{4}/\/\/ SPDX-FileCopyrightText: $current_year/" $changed_file
10
+done
11
12
+if test $(git status --porcelain | wc -l) -ne 0 ; then
13
+ echo "✨ Copyright year adjusted, please commit"
14
+fi
0 commit comments