1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Fix clang-format script behaviour without -i + code cleanup (#2002)

Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Oxan van Leeuwen
2021-07-25 23:54:32 +02:00
committed by GitHub
parent 66cdb761dc
commit 3749c11f21
4 changed files with 57 additions and 77 deletions

View File

@@ -46,16 +46,21 @@ jobs:
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
echo "::add-matcher::.github/workflows/matchers/gcc.json"
# Also run git-diff-index so that the step is marked as failed on formatting errors,
# since clang-format doesn't do anything but change files if -i is passed.
- name: Run clang-format
run: script/clang-format -i
run: |
script/clang-format -i
git diff-index --quiet HEAD --
if: ${{ matrix.id == 'clang-format' }}
- name: Run clang-tidy
run: script/clang-tidy --all-headers --fix --split-num 4 --split-at ${{ matrix.split }}
if: ${{ matrix.id == 'clang-tidy' }}
- name: Suggest changes
- name: Suggested changes
run: script/ci-suggest-changes
if: always()
ci:
# Don't use the esphome-lint docker image because it may contain outdated requirements.