From d466e73375139c6f6331ecd761fe616bfa629b8d Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Thu, 27 Sep 2018 15:17:59 +0930 Subject: [PATCH] travis: add copyright and imports checks --- .travis.yml | 8 ++++++++ .travis/check-copyright.sh | 4 ++++ .travis/check-imports.sh | 4 ++++ blas/netlib/bench_test.go | 4 ++++ blas/netlib/dgemmbench_test.go | 4 ++++ blas/netlib/dgemvbench_test.go | 4 ++++ blas/netlib/dgerbench_test.go | 4 ++++ blas/netlib/dtrmvbench_test.go | 2 +- blas/netlib/level1doubleBench_auto_test.go | 7 ++++--- lapack/lapacke/generate.go | 2 +- lapack/lapacke/generate_lapacke.go | 2 +- lapack/lapacke/lapacke.go | 2 +- lapack/netlib/bench_test.go | 2 +- lapack/netlib/lapack.go | 2 +- lapack/netlib/lapack_test.go | 2 +- 15 files changed, 43 insertions(+), 10 deletions(-) create mode 100755 .travis/check-copyright.sh create mode 100755 .travis/check-imports.sh diff --git a/.travis.yml b/.travis.yml index 0118fa83..44ff904c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,12 @@ matrix: - os: osx env: BLAS_LIB=OpenBLAS +before_install: + # Required for imports check. + - go get gonum.org/v1/tools/cmd/check-imports + # Required for copyright header check. + - go get gonum.org/v1/tools/cmd/check-copyright + # Cache used to persist the compiled BLAS library between CI calls. cache: directories: @@ -48,6 +54,8 @@ install: - travis_wait 20 source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh script: + - ${TRAVIS_BUILD_DIR}/.travis/check-imports.sh + - ${TRAVIS_BUILD_DIR}/.travis/check-copyright.sh - source ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/test.sh - test -z "$(gofmt -d .)" # This is run last since it alters the tree. diff --git a/.travis/check-copyright.sh b/.travis/check-copyright.sh new file mode 100755 index 00000000..209dca39 --- /dev/null +++ b/.travis/check-copyright.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-copyright -notice "Copyright ©20[0-9]{2} The Gonum Authors\. All rights reserved\." diff --git a/.travis/check-imports.sh b/.travis/check-imports.sh new file mode 100755 index 00000000..f88fc5ab --- /dev/null +++ b/.travis/check-imports.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +check-imports -b "math/rand,github.com/gonum/.*" diff --git a/blas/netlib/bench_test.go b/blas/netlib/bench_test.go index c726f45a..6eb888b4 100644 --- a/blas/netlib/bench_test.go +++ b/blas/netlib/bench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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. + package netlib import ( diff --git a/blas/netlib/dgemmbench_test.go b/blas/netlib/dgemmbench_test.go index 462b9eea..20643a25 100644 --- a/blas/netlib/dgemmbench_test.go +++ b/blas/netlib/dgemmbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2014 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. + package netlib import ( diff --git a/blas/netlib/dgemvbench_test.go b/blas/netlib/dgemvbench_test.go index 2c830e46..89de6ffe 100644 --- a/blas/netlib/dgemvbench_test.go +++ b/blas/netlib/dgemvbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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. + package netlib import ( diff --git a/blas/netlib/dgerbench_test.go b/blas/netlib/dgerbench_test.go index 955cd085..8ba427b4 100644 --- a/blas/netlib/dgerbench_test.go +++ b/blas/netlib/dgerbench_test.go @@ -1,3 +1,7 @@ +// Copyright ©2015 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. + package netlib import ( diff --git a/blas/netlib/dtrmvbench_test.go b/blas/netlib/dtrmvbench_test.go index 12f99ab6..06234e5d 100644 --- a/blas/netlib/dtrmvbench_test.go +++ b/blas/netlib/dtrmvbench_test.go @@ -1,4 +1,4 @@ -// Copyright ©2017 The gonum Authors. All rights reserved. +// 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. diff --git a/blas/netlib/level1doubleBench_auto_test.go b/blas/netlib/level1doubleBench_auto_test.go index 72995bf3..32dd4644 100644 --- a/blas/netlib/level1doubleBench_auto_test.go +++ b/blas/netlib/level1doubleBench_auto_test.go @@ -1,15 +1,16 @@ -// 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 // license that can be found in the LICENSE file package netlib import ( - "math/rand" "testing" + "golang.org/x/exp/rand" + "gonum.org/v1/gonum/blas" ) diff --git a/lapack/lapacke/generate.go b/lapack/lapacke/generate.go index e50c2da1..9942302f 100644 --- a/lapack/lapacke/generate.go +++ b/lapack/lapacke/generate.go @@ -1,4 +1,4 @@ -// Copyright ©2016 The gonum Authors. All rights reserved. +// Copyright ©2016 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. diff --git a/lapack/lapacke/generate_lapacke.go b/lapack/lapacke/generate_lapacke.go index 6d54f954..44d8f0ee 100644 --- a/lapack/lapacke/generate_lapacke.go +++ b/lapack/lapacke/generate_lapacke.go @@ -515,7 +515,7 @@ func address(buf *bytes.Buffer, d binding.Declaration, p binding.Parameter) bool const handwritten = `// Code generated by "go generate gonum.org/v1/netlib/lapack/lapacke" from {{.Header}}; DO NOT EDIT. -// Copyright ©2014 The gonum Authors. All rights reserved. +// Copyright ©2014 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. diff --git a/lapack/lapacke/lapacke.go b/lapack/lapacke/lapacke.go index 1274d205..b86b3e45 100644 --- a/lapack/lapacke/lapacke.go +++ b/lapack/lapacke/lapacke.go @@ -1,6 +1,6 @@ // Code generated by "go generate gonum.org/v1/netlib/lapack/lapacke" from lapacke.h; DO NOT EDIT. -// Copyright ©2014 The gonum Authors. All rights reserved. +// Copyright ©2014 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. diff --git a/lapack/netlib/bench_test.go b/lapack/netlib/bench_test.go index 8524ac00..2618ad8d 100644 --- a/lapack/netlib/bench_test.go +++ b/lapack/netlib/bench_test.go @@ -1,4 +1,4 @@ -// Copyright ©2016 The gonum Authors. All rights reserved. +// Copyright ©2016 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. diff --git a/lapack/netlib/lapack.go b/lapack/netlib/lapack.go index 6a8885ed..d2a3ee76 100644 --- a/lapack/netlib/lapack.go +++ b/lapack/netlib/lapack.go @@ -1,4 +1,4 @@ -// Copyright ©2015 The gonum Authors. All rights reserved. +// Copyright ©2015 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. diff --git a/lapack/netlib/lapack_test.go b/lapack/netlib/lapack_test.go index b17a7144..8808b1cd 100644 --- a/lapack/netlib/lapack_test.go +++ b/lapack/netlib/lapack_test.go @@ -1,4 +1,4 @@ -// Copyright ©2015 The gonum Authors. All rights reserved. +// Copyright ©2015 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.