mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-30 21:35:55 +00:00
CI: add lint github workflow for running clang-format (#3749)
so that we can identify changes which do not confirm to the clang-format rules. Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
parent
6855bd532b
commit
7d757cba5d
26
.github/workflows/lint.yml
vendored
Normal file
26
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.h'
|
||||||
|
- '**.cc'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format_code:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install clang-format
|
||||||
|
uses: aminya/setup-cpp@v1
|
||||||
|
with:
|
||||||
|
clangformat: 17.0.5
|
||||||
|
|
||||||
|
- name: Run clang-format
|
||||||
|
run: |
|
||||||
|
find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
|
||||||
|
git diff --exit-code
|
Loading…
Reference in New Issue
Block a user