mirror of
https://github.com/gonum/gonum.git
synced 2025-10-06 23:52:47 +08:00
travis: check for copyright headers
This commit is contained in:
@@ -26,6 +26,8 @@ before_install:
|
|||||||
- go get golang.org/x/tools/cmd/goimports
|
- go get golang.org/x/tools/cmd/goimports
|
||||||
# Required for imports check.
|
# Required for imports check.
|
||||||
- go get gonum.org/v1/tools/cmd/check-imports
|
- go get gonum.org/v1/tools/cmd/check-imports
|
||||||
|
# Required for copyright header check.
|
||||||
|
- go get gonum.org/v1/tools/cmd/check-copyright
|
||||||
# Required for coverage.
|
# Required for coverage.
|
||||||
- go get golang.org/x/tools/cmd/cover
|
- go get golang.org/x/tools/cmd/cover
|
||||||
- go get github.com/mattn/goveralls
|
- go get github.com/mattn/goveralls
|
||||||
@@ -37,6 +39,7 @@ go_import_path: gonum.org/v1/gonum
|
|||||||
# Get deps, build, test, and ensure the code is gofmt'ed.
|
# Get deps, build, test, and ensure the code is gofmt'ed.
|
||||||
# If we are building as gonum, then we have access to the coveralls api key, so we can run coverage as well.
|
# If we are building as gonum, then we have access to the coveralls api key, so we can run coverage as well.
|
||||||
script:
|
script:
|
||||||
|
- ${TRAVIS_BUILD_DIR}/.travis/check-copyright.sh
|
||||||
- ${TRAVIS_BUILD_DIR}/.travis/check-formatting.sh
|
- ${TRAVIS_BUILD_DIR}/.travis/check-formatting.sh
|
||||||
- go get -d -t -v ./...
|
- go get -d -t -v ./...
|
||||||
- go build -v ./...
|
- go build -v ./...
|
||||||
|
4
.travis/check-copyright.sh
Executable file
4
.travis/check-copyright.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
check-copyright -notice "Copyright ©20[0-9]{2} The Gonum Authors\. All rights reserved\."
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by "go run github.com/gonum/blas/testblas/benchautogen/autogen_bench_level1double.go"; DO NOT EDIT.
|
// Code generated by "go run gonum.org/v1/gonum/blas/testblas/benchautogen/autogen_bench_level1double.go"; DO NOT EDIT.
|
||||||
|
|
||||||
// Copyright 2014 The Gonum Authors. All rights reserved.
|
// Copyright ©2014 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file
|
// license that can be found in the LICENSE file
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2014 The Gonum Authors. All rights reserved.
|
// Copyright ©2014 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file
|
// license that can be found in the LICENSE file
|
||||||
|
|
||||||
@@ -9,14 +9,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
var gopath string
|
var gopath string
|
||||||
|
|
||||||
var copyrightnotice = []byte(`// Copyright 2014 The Gonum Authors. All rights reserved.
|
var copyrightnotice = []byte(`// Copyright ©2014 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file`)
|
// license that can be found in the LICENSE file`)
|
||||||
|
|
||||||
@@ -180,18 +179,16 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
blasPath := filepath.Join(gopath, "src", "gonum.org", "v1", "gonum", "blas")
|
pkgs := []string{"gonum", "netlib"}
|
||||||
|
|
||||||
pkgs := []struct{ name string }{{name: "native"}, {name: "cgo"}}
|
|
||||||
|
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
err := level1(filepath.Join(blasPath, pkg.name), pkg.name)
|
blasPath := filepath.Join(gopath, "src", "gonum.org", "v1", pkg, "blas", pkg)
|
||||||
|
err := level1(blasPath, pkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = exec.Command("go", "fmt", path.Join("gonum.org", "v1", "gonum", "blas", pkg.name)).Run()
|
err = exec.Command("goimports", "-w", blasPath).Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@@ -219,8 +216,7 @@ func level1(benchPath string, pkgname string) error {
|
|||||||
level1Filepath := filepath.Join(benchPath, "level1doubleBench_auto_test.go")
|
level1Filepath := filepath.Join(benchPath, "level1doubleBench_auto_test.go")
|
||||||
f, err := os.Create(level1Filepath)
|
f, err := os.Create(level1Filepath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
return err
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
printHeader(f, pkgname)
|
printHeader(f, pkgname)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2013 The Gonum Authors. All rights reserved.
|
// Copyright ©2013 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file
|
// license that can be found in the LICENSE file
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2013 The Gonum Authors. All rights reserved.
|
// Copyright ©2013 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file
|
// license that can be found in the LICENSE file
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2013 The Gonum Authors. All rights reserved.
|
// Copyright ©2013 The Gonum Authors. All rights reserved.
|
||||||
// Use of this code is governed by a BSD-style
|
// Use of this code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file
|
// license that can be found in the LICENSE file
|
||||||
|
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
// This file is dual licensed under CC0 and The gonum license.
|
||||||
|
//
|
||||||
|
// Copyright ©2017 The Gonum Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// Copyright ©2017 Robin Eklind.
|
||||||
|
// This file is made available under a Creative Commons CC0 1.0
|
||||||
|
// Universal Public Domain Dedication.`)
|
||||||
|
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
Reference in New Issue
Block a user