From 6cd56e72c14421a28e51a0bd482f2fb08ea6fe99 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 13 Oct 2020 20:53:45 +0100 Subject: [PATCH] fix lint failing on first commit to branch We now lint ALL files in the repository, not just those detected as changed in the commit (the procedure to do this failed when HEAD was exactly 1 commit ahead of the base branch). Also we now only lint pull requests, not in-progress pushes to any branch. --- .clang-tidy | 2 +- .github/workflows/lint.yaml | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 861332a8f2..bbfbd5c7db 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,2 +1,2 @@ -Checks: '-*,clang-analyzer-core.*,clang-analyzer-deadcode.*,readability-*,-readability-magic-numbers,-readability-else-after-return,-readability-named-parameter,-readability-braces-around-statements,-readability-isolate-declaration,-readability-uppercase-literal-suffix,-readability-function-size,-readability-non-const-parameter,-clang-diagnostic-error' +Checks: '-*,clang-analyzer-core.*,clang-analyzer-deadcode.*,readability-*,-readability-magic-numbers,-readability-else-after-return,-readability-named-parameter,-readability-braces-around-statements,-readability-isolate-declaration,-readability-uppercase-literal-suffix,-readability-function-size,-readability-non-const-parameter' HeaderFilterRegex: '(src|include)\/.*\.h' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 61956f6155..29a5706a47 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,13 +1,11 @@ name: Lint on: - push: - paths: - - 'src/*' - - 'include/*' pull_request: paths: - 'src/*' - 'include/*' + - 'format.sh' + - '.clang-tidy' jobs: build: @@ -18,18 +16,9 @@ jobs: - run: sudo apt-get install -y astyle clang-tidy - # lint files changed by the push/pr - - id: files - uses: trilom/file-changes-action@v1.2.4 - with: - output: ' ' - continue-on-error: true - - run: ./format.sh ${{ steps.files.outputs.files}} - if: ${{ steps.files.outcome == 'success' }} - run: ./format.sh - if: ${{ steps.files.outcome == 'failure' }} - # fail if any files were changed by ./format.sh + # Detect any files changed by ./format.sh - id: files_formatted uses: jackton1/find-changed-files@v1.1 with: