aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-29 13:35:50 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-29 13:36:11 +0200
commita3d497bf6ccc7141b66ada4b01a05068a09b31c3 (patch)
tree8c54ab480169dff2739c565cc06bbeaa20e76eba /tools
parent9534e89c796edb8b7c0e8197c7e4ddca149d9526 (diff)
all: fix marking of auto-generated files
Update the copyright checking script and more files for the standard convention of marking auto-generated files.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-copyright.sh2
-rw-r--r--tools/syz-usbgen/usbgen.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/check-copyright.sh b/tools/check-copyright.sh
index c6dcb36ce..ba6423b9e 100755
--- a/tools/check-copyright.sh
+++ b/tools/check-copyright.sh
@@ -11,7 +11,7 @@ for F in $(find . -name "*.go" -o -name "*.sh" -o -name "*.cc" -o -name "*.h" \
cat $F | tr '\n' '_' | egrep "(//|#) Copyright 20[0-9]{2}(/20[0-9]{2})? syzkaller project authors\. All rights reserved\._(//|#) Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file\." >/dev/null
if [ $? -eq 0 ]; then continue; fi
# Ignore auto-generated files.
- egrep "(//|#) AUTOGENERATED FILE|(WARNING: This file is machine generated)" $F >/dev/null
+ egrep "^(//|#) Code generated .* DO NOT EDIT\\.|(WARNING: This file is machine generated)" $F >/dev/null
if [ $? -eq 0 ]; then continue; fi
# Ignore untracked files.
git ls-files --error-unmatch $F >/dev/null 2>&1
diff --git a/tools/syz-usbgen/usbgen.go b/tools/syz-usbgen/usbgen.go
index 61943f039..5b41c28e4 100644
--- a/tools/syz-usbgen/usbgen.go
+++ b/tools/syz-usbgen/usbgen.go
@@ -30,12 +30,12 @@ func main() {
usbIds := extractIds(syslog, "USBID", 34)
hidIds := extractIds(syslog, "HIDID", 24)
- output := make([]byte, 0)
- output = append(output, []byte("// AUTOGENERATED FILE\n")...)
- output = append(output, []byte("// See docs/linux/external_fuzzing_usb.md\n")...)
- output = append(output, []byte("\n")...)
- output = append(output, []byte("package linux\n")...)
- output = append(output, []byte("\n")...)
+ output := []byte(`// Code generated by tools/syz-usbgen. DO NOT EDIT.
+// See docs/linux/external_fuzzing_usb.md
+
+package linux
+
+`)
output = append(output, generateIdsVar(usbIds, "usbIds")...)
output = append(output, []byte("\n")...)
output = append(output, generateIdsVar(hidIds, "hidIds")...)