File: vet.sh

package info (click to toggle)
golang-github-googleapis-gax-go 2.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 568 kB
  • sloc: sh: 55; makefile: 7
file content (35 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

# Fail on any error
set -eo

# Display commands being run
set -x

if [[ $KOKORO_JOB_NAME != *"latest-version"* ]]; then
  exit 0
fi

# Look at all .go files (ignoring .pb.go files) and make sure they have a Copyright. Fail if any don't.
find . -type f -name "*.go" ! -name "*.pb.go" -exec grep -L "\(Copyright [0-9]\{4,\}\)" {} \; 2>&1 | tee /dev/stderr | (! read)

# Fail if a dependency was added without the necessary go.mod/go.sum change
# being part of the commit.
go mod tidy
git diff go.mod | tee /dev/stderr | (! read)
git diff go.sum | tee /dev/stderr | (! read)

pushd v2
  go mod tidy
  git diff go.mod | tee /dev/stderr | (! read)
  git diff go.sum | tee /dev/stderr | (! read)
popd

# Easier to debug CI.
pwd

gofmt -s -d -l . 2>&1 | tee /dev/stderr | (! read)
goimports -l . 2>&1 | tee /dev/stderr | (! read)

golint ./... 2>&1 | tee /dev/stderr | (! read)
staticcheck ./...