all: run gofumpt (#652)
* all: run gofumpt https://github.com/mvdan/gofumpt The main appeal for me here is that my (and many other peoples') editors run this on save, so doing a single diff here keeps other diffs minimal. * .github/workflows: add gofumpt checker
This commit is contained in:
parent
6b9dbc3b05
commit
89ab72bee0
33 changed files with 63 additions and 145 deletions
34
.github/workflows/gofumpt.yml
vendored
Normal file
34
.github/workflows/gofumpt.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name: check gofumpt
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
gofumpt:
|
||||
name: Check gofumpt formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Download gofumpt binary
|
||||
run: |
|
||||
curl -L https://github.com/mvdan/gofumpt/releases/download/v0.8.0/gofumpt_v0.8.0_linux_amd64 -o /tmp/gofumpt
|
||||
chmod +x /tmp/gofumpt
|
||||
|
||||
- name: Check gofumpt formatting
|
||||
run: |
|
||||
unformatted_files=$(/tmp/gofumpt -l .)
|
||||
if [ -n "$unformatted_files" ]; then
|
||||
echo "The following files are not gofumpt'd:"
|
||||
echo "$unformatted_files"
|
||||
echo
|
||||
echo "Please run: gofumpt -w ."
|
||||
exit 1
|
||||
fi
|
||||
echo "All files are properly formatted"
|
||||
Loading…
Add table
Add a link
Reference in a new issue