Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Feb 5, 2024
1 parent 2b8b702 commit 8d4a465
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
deadline: 10m
timeout: 10m

output:
format: github-actions,colored-line-number
Expand Down
2 changes: 1 addition & 1 deletion cmd/dcrdata/internal/middleware/apimiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func ChartGroupingCtx(next http.Handler) http.Handler {

// apiDocs generates a middleware with a "docs" in the context containing a map
// of the routers handlers, etc.
func apiDocs(mux *chi.Mux) func(next http.Handler) http.Handler {
func apiDocs(mux *chi.Mux) func(next http.Handler) http.Handler { //nolint
var buf bytes.Buffer
err := json.Indent(&buf, []byte(docgen.JSONRoutesDoc(mux)), "", "\t")
if err != nil {
Expand Down
5 changes: 0 additions & 5 deletions exchanges/rateserver/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,3 @@ func (client *rateClient) SendExchangeUpdate(update *dcrrates.ExchangeRateUpdate
func (client *rateClient) Stream() GRPCStream {
return client.stream
}

// Determine if the grpc.ServerStream's context Done() channel has been closed.
func (client *rateClient) isDone() bool {
return client.stream.Context().Err() != nil
}
16 changes: 1 addition & 15 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ MODPATHS="./go.mod ./exchanges/go.mod ./gov/go.mod ./db/dcrpg/go.mod ./cmd/dcrda
./testutil/apiload/go.mod ./exchanges/rateserver/go.mod"
#MODPATHS=$(find . -name go.mod -type f -print)

alias superlint="golangci-lint run --deadline=10m \
--disable-all \
--enable govet \
--enable staticcheck \
--enable gosimple \
--enable unconvert \
--enable ineffassign \
--enable structcheck \
--enable goimports \
--enable misspell \
--enable unparam \
--enable asciicheck \
--enable makezero"

# run lint on all listed modules
set +e
ERROR=0
Expand All @@ -55,7 +41,7 @@ for MODPATH in $MODPATHS; do
module=$(dirname "${MODPATH}")
pushd "$module" > /dev/null
echo "Linting: $MODPATH"
superlint
golangci-lint run
if [[ "$GV" =~ ^1.21 ]]; then
MOD_STATUS=$(git status --porcelain go.mod go.sum)
go mod tidy
Expand Down

0 comments on commit 8d4a465

Please sign in to comment.