mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: add import formatting to make fmt/go (#21453)
Modifies `make fmt/go` to also use https://github.com/daixiang0/gci to format our imports to a standard format. It introduces a new shell script to do the formatting so that our formatting tools are in one place.
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script formats Go file(s) with our project-specific configuration.
|
||||
|
||||
# Usage: format_go_file <file>...
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "$#" -lt 1 ]]; then
|
||||
echo "Usage: $0 <file>..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
go run mvdan.cc/gofumpt@v0.8.0 -w -l "${@}"
|
||||
go run github.com/daixiang0/gci@v0.13.7 write -s standard -s default -s "Prefix(github.com/coder,cdr.dev/)" "${@}"
|
||||
Reference in New Issue
Block a user