Skip to content

Commit

Permalink
improve clang-tidy setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-m committed Dec 20, 2023
1 parent 36d8c68 commit d46232e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 79
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!go.mod
!go.sum
!Makefile
!.clang-format

!cmd
!examples
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ GO_STATICCHECK_VERSION = 2023.1.6
DEFAULT: format build_host build_arm64

format:
cd pkg/pmatch && clang-format -i -style="{BasedOnStyle: Google, IndentWidth: 2, ColumnLimit: 79}" *.h *.c
bash -c "shopt -s globstar; clang-format -i **/*.c **/*.h"
gofmt -w .
go mod tidy

lint:
bash -c "shopt -s globstar; clang-format --dry-run --Werror **/*.c **/*.h"
gofmt -l .; test -z "$$(gofmt -l .)"
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@$(GO_STATICCHECK_VERSION) -checks=all ./...
Expand Down

0 comments on commit d46232e

Please sign in to comment.