style: format bpf c code using kernel checkpatch.pl (#477)

This commit is contained in:
/gray 2024-03-15 20:26:21 +08:00 committed by GitHub
parent 49f576e37d
commit d31d8802ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9046 additions and 1178 deletions

23
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Lint
on:
pull_request:
paths:
- "**/*.c"
- "**/*.h"
- ".github/workflows/lint.yml"
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.38"
- name: Run lint
run: make ebpf-lint

View File

@ -96,4 +96,7 @@ ebpf: submodule clean-ebpf
go generate ./control/control.go && \ go generate ./control/control.go && \
go generate ./trace/trace.go && echo trace > $(BUILD_TAGS_FILE) || echo > $(BUILD_TAGS_FILE) go generate ./trace/trace.go && echo trace > $(BUILD_TAGS_FILE) || echo > $(BUILD_TAGS_FILE)
ebpf-lint:
./scripts/checkpatch.pl --no-tree --strict --no-summary --show-types --color=always control/kern/tproxy.c --ignore COMMIT_COMMENT_SYMBOL,NOT_UNIFIED_DIFF,COMMIT_LOG_LONG_LINE,LONG_LINE_COMMENT,VOLATILE,ASSIGN_IN_IF,PREFER_DEFINED_ATTRIBUTE_MACRO,CAMELCASE,LEADING_SPACE
## End Ebpf ## End Ebpf

File diff suppressed because it is too large Load Diff

7805
scripts/checkpatch.pl Executable file

File diff suppressed because it is too large Load Diff