mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
add clang formatter github action
This commit is contained in:
parent
2fff1d5a28
commit
383cc26902
29
.github/workflows/clang-format.yml
vendored
Normal file
29
.github/workflows/clang-format.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Code Formatting
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
# push:
|
||||||
|
# branches: [ master ]
|
||||||
|
# pull_request:
|
||||||
|
# branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- name: requirements
|
||||||
|
run: |
|
||||||
|
sudo apt -qq -y update
|
||||||
|
sudo apt -qq install clang-format
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Formatter
|
||||||
|
run: find -name '*.c' -o -name '*.h' | \
|
||||||
|
xargs clang-format -i -style="{ BasedOnStyle: LLVM, UseTab: Never, \
|
||||||
|
IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, \
|
||||||
|
AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, \
|
||||||
|
ColumnLimit: 80, AccessModifierOffset: -4 }"
|
||||||
|
- name: test
|
||||||
|
run: git diff
|
||||||
|
|
Loading…
Reference in New Issue
Block a user