all: mark auto-generated files

Use the standard Go convention for Go files:
https://golang.org/pkg/cmd/go/internal/generate
Use github linguish for other files:
https://github.com/github/linguist#generated-code

Both are understood by github and should result
in these files being collapsed in PRs by default.
This commit is contained in:
Dmitry Vyukov 2020-07-29 12:53:57 +02:00
parent 8ab0cf5b55
commit 9534e89c79
9 changed files with 10 additions and 8 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
executor/kvm.S.h linguist-generated

View File

@ -1,7 +1,7 @@
// Copyright 2017 syzkaller project authors. All rights reserved. // Copyright 2017 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.
//go:generate bash -c "echo -en '// AUTOGENERATED FILE\n\n' > linux_generated.go" //go:generate bash -c "echo -en '// Code generated by pkg/build/linux.go. DO NOT EDIT.\n\n' > linux_generated.go"
//go:generate bash -c "echo -en 'package build\n\n' >> linux_generated.go" //go:generate bash -c "echo -en 'package build\n\n' >> linux_generated.go"
//go:generate bash -c "echo -en 'const createImageScript = `#!/bin/bash\n' >> linux_generated.go" //go:generate bash -c "echo -en 'const createImageScript = `#!/bin/bash\n' >> linux_generated.go"
//go:generate bash -c "cat ../../tools/create-gce-image.sh | grep -v '#' >> linux_generated.go" //go:generate bash -c "cat ../../tools/create-gce-image.sh | grep -v '#' >> linux_generated.go"

View File

@ -1,4 +1,4 @@
// AUTOGENERATED FILE // Code generated by pkg/build/linux.go. DO NOT EDIT.
package build package build

View File

@ -53,7 +53,7 @@ func main() {
} { } {
data = regexp.MustCompile(remove).ReplaceAll(data, nil) data = regexp.MustCompile(remove).ReplaceAll(data, nil)
} }
fmt.Fprintf(out, "// AUTOGENERATED FILE FROM executor/*.h\n\n") fmt.Fprintf(out, "// Code generated by gen.go from executor/*.h. DO NOT EDIT.\n\n")
fmt.Fprintf(out, "package csource\n\nvar commonHeader = `\n") fmt.Fprintf(out, "package csource\n\nvar commonHeader = `\n")
out.Write(data) out.Write(data)
fmt.Fprintf(out, "`\n") fmt.Fprintf(out, "`\n")

View File

@ -1,4 +1,4 @@
// AUTOGENERATED FILE FROM executor/*.h // Code generated by gen.go from executor/*.h. DO NOT EDIT.
package csource package csource

View File

@ -1,3 +1,4 @@
// Code generated by pkg/html/html.go. DO NOT EDIT.
package html package html
const style = ` const style = `

View File

@ -1,8 +1,8 @@
// Copyright 2018 syzkaller project authors. All rights reserved. // 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.
//go:generate bash -c "echo '// AUTOGENERATED FILE' > generated.go" //go:generate bash -c "echo '// Code generated by pkg/html/html.go. DO NOT EDIT.' > generated.go"
//go:generate bash -c "echo 'package html' > generated.go" //go:generate bash -c "echo 'package html' >> generated.go"
//go:generate bash -c "echo 'const style = `' >> generated.go" //go:generate bash -c "echo 'const style = `' >> generated.go"
//go:generate bash -c "cat ../../dashboard/app/static/style.css >> generated.go" //go:generate bash -c "cat ../../dashboard/app/static/style.css >> generated.go"
//go:generate bash -c "echo '`' >> generated.go" //go:generate bash -c "echo '`' >> generated.go"

View File

@ -163,7 +163,7 @@ nextInsn:
fmt.Fprintf(os.Stderr, "deduped %v instructions\n", len(insns)-len(deduped)) fmt.Fprintf(os.Stderr, "deduped %v instructions\n", len(insns)-len(deduped))
insns = deduped insns = deduped
fmt.Printf("// AUTOGENERATED FILE\n\n") fmt.Printf("// Code generated by pkg/ifuzz/gen. DO NOT EDIT.\n\n")
fmt.Printf("// +build !codeanalysis\n\n") fmt.Printf("// +build !codeanalysis\n\n")
fmt.Printf("package generated\n\n") fmt.Printf("package generated\n\n")
fmt.Printf("import . \"github.com/google/syzkaller/pkg/ifuzz\"\n\n") fmt.Printf("import . \"github.com/google/syzkaller/pkg/ifuzz\"\n\n")

View File

@ -1,4 +1,4 @@
// AUTOGENERATED FILE // Code generated by pkg/ifuzz/gen. DO NOT EDIT.
// +build !codeanalysis // +build !codeanalysis