all: upgrade golangci-lint and formatters (#240)
This commit is contained in:
committed by
GitHub
parent
553930530f
commit
72b8db9c80
@@ -8,8 +8,11 @@ files=$(find . -name '*.go' -not -path '*/stadtx/*')
|
||||
|
||||
# Remove blank lines in import blocks. This will force formatting to group
|
||||
# imports correctly.
|
||||
sed -i.fmtbackup '/^import (/,/)/ { /^$$/ d; }' ${files}
|
||||
sed -i.fmtbackup '/^import (/,/)/ { /^[ \t]*$/ d; }' ${files}
|
||||
find . -name '*.fmtbackup' -delete
|
||||
|
||||
# gofumports is goimports with stricter formatting.
|
||||
gofumports -w -local ${repo} ${files}
|
||||
# goimports for import grouping.
|
||||
goimports -w -local "${repo}" ${files}
|
||||
|
||||
# gofumpt for stricter gofmt-compatible format.
|
||||
gofumpt -w ${files}
|
||||
|
||||
Reference in New Issue
Block a user