2024-12-30 15:18:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# With golangci-lint, if there are any compliation issues, then formatters' autofix won't be applied.
|
|
|
|
# https://github.com/golangci/golangci-lint/issues/5257
|
|
|
|
# However, running goimports first alone will actually fix some of the compilation issues.
|
|
|
|
# Fixing formatting is also reasonable thing to do.
|
|
|
|
# For this reason, this script runs golangci-lint in two stages:
|
2024-12-30 18:39:33 +00:00
|
|
|
golangci-lint run --enable-only="gofmt,gofumpt,goimports" --fix $@
|
2024-12-30 15:18:57 +00:00
|
|
|
exec golangci-lint run --fix $@
|