mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[IMPROVEMENT] Clang format (#1222)
* Add .clang-format * Add clang-format github action * Set more explicit name to GitHub workflow Co-Authored-By: Willem <github@canihavesome.coffee> Co-authored-by: Willem <github@canihavesome.coffee>
This commit is contained in:
7
.clang-format
Normal file
7
.clang-format
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
BreakBeforeBraces: Allman
|
||||||
|
ColumnLimit: 0
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentWidth: 8
|
||||||
|
TabWidth: 8
|
||||||
|
UseTab: Always
|
||||||
|
SortIncludes: false
|
||||||
16
.github/workflows/format.yml
vendored
Normal file
16
.github/workflows/format.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Format sourcecode
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||||
|
sudo add-apt-repository -y 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||||
|
sudo apt install clang-format-9
|
||||||
|
- name: Format code
|
||||||
|
run: |
|
||||||
|
find src/ -type f -name '*.c' -name '*.c' | xargs clang-format-9 -i
|
||||||
|
git diff-index --quiet HEAD -- || (git diff && exit 1)
|
||||||
2
src/thirdparty/.clang-format
vendored
Normal file
2
src/thirdparty/.clang-format
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: false
|
||||||
Reference in New Issue
Block a user