From d2bbc76d8f5b248b4b90edb57064ad364c536d2a Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Fri, 21 Jun 2024 22:34:41 +0300 Subject: [PATCH] add clang-format Signed-off-by: Ari Archer --- .clang-format | 19 +++++++++++ stats.yaml | 92 +++++++++++++++++++++++++-------------------------- 2 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1f4f375 --- /dev/null +++ b/.clang-format @@ -0,0 +1,19 @@ +--- +BasedOnStyle: LLVM +IndentWidth: 4 +SortIncludes: false +AlignConsecutiveAssignments: true +AlignConsecutiveBitFields: true +AlignConsecutiveMacros: true +AlignEscapedNewlines: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: true +AllowShortLambdasOnASingleLine: true +BinPackParameters: false +IndentCaseBlocks: true +IndentCaseLabels: true +IndentExternBlock: true +IndentGotoLabels: true +--- + diff --git a/stats.yaml b/stats.yaml index f92615c..c9f8815 100644 --- a/stats.yaml +++ b/stats.yaml @@ -1,55 +1,55 @@ on: - push: - branches: - - main - paths-ignore: - - 'commits.png' - - 'languages.png' - schedule: - - cron: '0 */8 * * *' + push: + branches: + - main + paths-ignore: + - "commits.png" + - "languages.png" + schedule: + - cron: "0 */8 * * *" jobs: - stats: - runs-on: docker - container: catthehacker/ubuntu:act-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GIT_TOKEN }} + stats: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GIT_TOKEN }} - - name: Check for Skip CI in Last Commit - id: check_commit - run: | - commit_message=$(git log -1 --pretty=%B) - if echo "$commit_message" | grep -q "\[skip ci\]"; then - echo "Skip CI based on commit message" && exit 78; - fi + - name: Check for Skip CI in Last Commit + id: check_commit + run: | + commit_message=$(git log -1 --pretty=%B) + if echo "$commit_message" | grep -q "\[skip ci\]"; then + echo "Skip CI based on commit message" && exit 78; + fi - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: "pip" - - name: Install dependencies - run: | - pip install -r requirements.txt + - name: Install dependencies + run: | + pip install -r requirements.txt - - name: Generate statistics - run: | - python3 stats.py + - name: Generate statistics + run: | + python3 stats.py - - name: Stage the changes - run: | - git add languages.png commits.png + - name: Stage the changes + run: | + git add languages.png commits.png - - name: Commit and Push Changes - run: | - if git diff --staged --quiet; then - echo "No changes to commit." - else - git config --local user.email "stats@localhost" - git config --local user.name "Stats CI/CD" - git add commits.png languages.png - git commit -am "Update stats" || echo "No changes to commit" - git push origin HEAD - fi + - name: Commit and Push Changes + run: | + if git diff --staged --quiet; then + echo "No changes to commit." + else + git config --local user.email "stats@localhost" + git config --local user.name "Stats CI/CD" + git add commits.png languages.png + git commit -am "[skip ci] Update stats" || echo "No changes to commit" + git push origin HEAD + fi