2020-05-29 14:40:03 -04:00
|
|
|
name: Code Formatting
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
# push:
|
|
|
|
# branches: [ master ]
|
|
|
|
# pull_request:
|
|
|
|
# branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-05-29 14:44:04 -04:00
|
|
|
- name: requirements
|
|
|
|
run: |
|
|
|
|
sudo apt -qq -y update
|
|
|
|
sudo apt -qq install clang-format
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
- name: Formatter
|
2020-05-29 14:57:18 -04:00
|
|
|
run: |
|
2020-05-29 16:00:57 -04:00
|
|
|
for fname in $(find . -name '*.c' -o -name '*.h')
|
|
|
|
do
|
|
|
|
echo "$fname"
|
|
|
|
clang-format --verbose -i --style="$line1 $line2 $line3 $line4" "$fname"
|
|
|
|
done
|
2020-05-29 15:50:35 -04:00
|
|
|
env:
|
|
|
|
line1: "{ BasedOnStyle: LLVM, UseTab: Never,"
|
|
|
|
line2: "IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman,"
|
|
|
|
line3: "AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false,"
|
|
|
|
line4: "ColumnLimit: 80, AccessModifierOffset: -4 }"
|
2020-05-29 14:44:04 -04:00
|
|
|
- name: test
|
2020-05-29 16:00:57 -04:00
|
|
|
if: always()
|
2020-05-29 15:42:52 -04:00
|
|
|
run: git status
|
2020-05-29 14:40:03 -04:00
|
|
|
|