diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-02-18 16:02:42 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-02-18 16:05:10 +0100 |
| commit | 135c18aadb0147f93d3e2658e42fc7a479b9ad04 (patch) | |
| tree | 74ba2b3a708ebe1f06a79adb73e4b44785ba4d95 /tools | |
| parent | 012fbc3229ebef871a201ea431b16610e6e0d345 (diff) | |
tools: add script that checks copyright headers
Fixes #1604
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/check-copyright.sh | 21 | ||||
| -rwxr-xr-x | tools/create-openbsd-gce-ci.sh | 3 | ||||
| -rwxr-xr-x | tools/create-openbsd-vmm-worker.sh | 3 | ||||
| -rw-r--r-- | tools/syz-trace2syz/proggen/call_selector.go | 3 |
4 files changed, 26 insertions, 4 deletions
diff --git a/tools/check-copyright.sh b/tools/check-copyright.sh new file mode 100755 index 000000000..86067564c --- /dev/null +++ b/tools/check-copyright.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2020 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. + +FILES=0 +FAILED="" +for F in $(find -name "*.go" -o -name "*.sh" -o \( -path "./sys/*/*.txt" \) | egrep -v "/vendor/|/gen/"); do + ((FILES+=1)) + 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 + if [ $? -eq 0 ]; then continue; fi + # Ignore untracked files. + git ls-files --error-unmatch $F >/dev/null 2>&1 + if [ $? -ne 0 ]; then continue; fi + echo "$F: does not have standard copyright statement" + FAILED="1" +done +if [ "$FAILED" != "" ]; then exit 1; fi +echo "$FILES files checked for copyright statement" diff --git a/tools/create-openbsd-gce-ci.sh b/tools/create-openbsd-gce-ci.sh index 5f1e5d960..22364d2e9 100755 --- a/tools/create-openbsd-gce-ci.sh +++ b/tools/create-openbsd-gce-ci.sh @@ -1,8 +1,7 @@ #!/bin/bash # Copyright 2018 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. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. # Produces GCE image of syz-ci running on OpenBSD. diff --git a/tools/create-openbsd-vmm-worker.sh b/tools/create-openbsd-vmm-worker.sh index d0d01fe11..4e0eaf466 100755 --- a/tools/create-openbsd-vmm-worker.sh +++ b/tools/create-openbsd-vmm-worker.sh @@ -1,8 +1,7 @@ #!/bin/bash # Copyright 2018 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. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. # Produces a very minimal image for running syzkaller fuzzers running on OpenBSD. diff --git a/tools/syz-trace2syz/proggen/call_selector.go b/tools/syz-trace2syz/proggen/call_selector.go index 5ace0fd2a..886c82636 100644 --- a/tools/syz-trace2syz/proggen/call_selector.go +++ b/tools/syz-trace2syz/proggen/call_selector.go @@ -1,3 +1,6 @@ +// Copyright 2018 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. + package proggen import ( |
