Skip to content

Commit 8c15a34

Browse files
committed
[FAB-9594] generated files not license checked
Exclude files containing the generated magic string in the top two lines from license checks. These files are generated by tools from source. Change-Id: Id20084f0e68cec405c0abae0cbd4c77eb49945b3 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent 5cf28ef commit 8c15a34

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/check_license.sh

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# SPDX-License-Identifier: Apache-2.0
66
#
77

8+
function filterGeneratedFiles {
9+
for f in $@; do
10+
head -n2 $f | grep -qE 'Code generated by.*DO NOT EDIT' || echo $f
11+
done
12+
}
13+
814
function filterExcludedFiles {
915
CHECK=`echo "$CHECK" \
1016
| grep -v "^\.git/" \
@@ -24,6 +30,8 @@ function filterExcludedFiles {
2430
| grep -v "\.md$" \
2531
| grep -v "\.pb\.go$" \
2632
| sort -u`
33+
34+
CHECK=$(filterGeneratedFiles "$CHECK")
2735
}
2836

2937
CHECK=$(git diff --name-only --diff-filter=ACMRTUXB HEAD)

0 commit comments

Comments
 (0)