github.com/decred/politeia@v1.4.0/goclean.sh (about)

     1  #!/bin/bash
     2  # The script does automatic checking on a Go package and its sub-packages, including:
     3  # 1. gofmt         (http://golang.org/cmd/gofmt/)
     4  # 2. go vet        (http://golang.org/cmd/vet)
     5  # 3. gosimple      (https://github.com/dominikh/go-simple)
     6  # 4. unconvert     (https://github.com/mdempsky/unconvert)
     7  # 5. ineffassign   (https://github.com/gordonklaus/ineffassign)
     8  # 6. misspell      (https://github.com/client9/misspell)
     9  # 7. bodyclose     (https://github.com/timakin/bodyclose)
    10  # 8. race detector (http://blog.golang.org/race-detector)
    11  # 9. test coverage (http://blog.golang.org/cover)
    12  
    13  set -ex
    14  
    15  # run tests
    16  env GORACE="halt_on_error=1" go test -short -race ./...
    17  
    18  # golangci-lint (github.com/golangci/golangci-lint) is used to run each each
    19  # static checker.
    20  
    21  # check linters
    22  golangci-lint run --disable-all --deadline=10m \
    23    --enable=gofmt \
    24    --enable=vet \
    25    --enable=gosimple \
    26    --enable=unconvert \
    27    --enable=ineffassign \
    28    --enable=misspell \
    29    --enable=bodyclose \
    30    --enable=rowserrcheck \
    31    --enable=sqlclosecheck \