Skip to content

Commit 78208ab

Browse files
ci: inline gofmt hook and remove helper scripts
1 parent c8b5d48 commit 78208ab

File tree

3 files changed

+2
-72
lines changed

3 files changed

+2
-72
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ repos:
33
hooks:
44
- id: gofmt
55
name: gofmt
6-
entry: gofmt -s -w
6+
# Format each passed Go file and re-stage it if it's not ignored.
7+
entry: bash -c 'for f; do [ -e "$f" ] || continue; gofmt -s -w "$f"; if ! git check-ignore -q -- "$f"; then git add -- "$f"; fi; done' --
78
language: system
89
pass_filenames: true
910
types: [go]

scripts/commit-with-pre-commit.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

scripts/gofmt-add.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)