diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 0d0b1c99..00000000 --- a/.github/stale.yml +++ /dev/null @@ -1 +0,0 @@ -_extends: .github diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..952263f2 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,10 @@ +name: 'Close stale issues' +on: + schedule: + - cron: '30 1 * * *' +permissions: + issues: write + +jobs: + stale: + uses: cpp-linter/.github/.github/workflows/stale.yml@main diff --git a/README.md b/README.md index b7df919e..61ccaef8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ # C/C++ Linter Action | clang-format & clang-tidy ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cpp-linter/cpp-linter-action) -[![Used by](https://img.shields.io/static/v1?label=Used%20by&message=529&color=informational&logo=slickpic)](https://github.com/cpp-linter/cpp-linter-action/network/dependents) +[![Used by](https://img.shields.io/static/v1?label=Used%20by&message=573&color=informational&logo=slickpic)](https://github.com/cpp-linter/cpp-linter-action/network/dependents) [![GitHub marketplace](https://img.shields.io/badge/marketplace-C%2FC%2B%2B%20Linter-blue?logo=github)](https://github.com/marketplace/actions/c-c-linter) [![cpp-linter](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/cpp-linter.yml/badge.svg)](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/cpp-linter.yml) [![MkDocs Deploy](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/mkdocs-deploy.yml/badge.svg)](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/mkdocs-deploy.yml) diff --git a/action.yml b/action.yml index 03dfff39..a676f410 100644 --- a/action.yml +++ b/action.yml @@ -94,7 +94,20 @@ inputs: - Prefix a path with a bang (`!`) to make it explicitly _not_ ignored. The order of multiple paths does _not_ take precedence. The `!` prefix can be applied to a submodule's path (if desired) but not hidden directories. - - Glob patterns are not supported here. All asterisk characters (`*`) are literal. + - **As of v2.12**, glob patterns are supported here. + All asterisk characters (`*`) were previously literal. + required: false + default: '.github' + ignore-tidy: + description: |- + Use this option to allow clang-tidy to ignore certain paths/files. + See [`ignore`](#ignore) for more details on possible values. + required: false + default: '.github' + ignore-format: + description: |- + Use this option to allow clang-format to ignore certain paths/files. + See [`ignore`](#ignore) for more details on possible values. required: false default: '.github' thread-comments: @@ -191,6 +204,11 @@ inputs: > The [`no-lgtm`](#no-lgtm) option is applicable to Pull Request reviews. required: false default: false + passive-reviews: + description: | + Set this option to `true` to prevent Pull Request reviews from approving or requesting changes. + default: false + required: false jobs: description: | The number of jobs to run in parallel. @@ -234,6 +252,15 @@ runs: fi fi + - name: Install MacOS clang dependencies + if: runner.os == 'macOS' + shell: bash + continue-on-error: true + run: | + brew install llvm@${{ inputs.version }} + ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-format" "/usr/local/bin/clang-format-${{ inputs.version }}" + ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-tidy" "/usr/local/bin/clang-tidy-${{ inputs.version }}" + - name: Setup python venv (Unix) if: runner.os == 'Linux' || runner.os == 'macOS' shell: bash @@ -263,11 +290,14 @@ runs: --no-lgtm=${{ inputs.no-lgtm }} \ --step-summary=${{ inputs.step-summary }} \ --ignore="${{ inputs.ignore }}" \ + --ignore-tidy="${{ inputs.ignore-tidy }}" \ + --ignore-format="${{ inputs.ignore-format }}" \ --database=${{ inputs.database }} \ --file-annotations=${{ inputs.file-annotations }} \ --extra-arg="${{ inputs.extra-args }}" \ --tidy-review="${{ inputs.tidy-review }}" \ --format-review="${{ inputs.format-review }}" \ + --passive-reviews="${{ inputs.passive-reviews }}" \ --jobs=${{ inputs.jobs }} - name: Setup python venv (Windows) @@ -299,11 +329,14 @@ runs: ' --no-lgtm=${{ inputs.no-lgtm }}' + ' --step-summary=${{ inputs.step-summary }}' + ' --ignore="${{ inputs.ignore }}"' + + ' --ignore-tidy="${{ inputs.ignore-tidy }}"' + + ' --ignore-format="${{ inputs.ignore-format }}"' + ' --database=${{ inputs.database }}' + ' --file-annotations=${{ inputs.file-annotations }}' + ' --extra-arg="${{ inputs.extra-args }}"' + ' --tidy-review="${{ inputs.tidy-review }}"' + ' --format-review="${{ inputs.format-review }}"' + + ' --passive-reviews="${{ inputs.passive-reviews }}"' + ' --jobs=${{ inputs.jobs }}' Invoke-Expression -Command $app diff --git a/docs/action.yml b/docs/action.yml index 40b65cd3..5e5c7982 100644 --- a/docs/action.yml +++ b/docs/action.yml @@ -20,6 +20,10 @@ inputs: required-permission: 'contents: read #file-changes' ignore: minimum-version: '1.3.0' + ignore-tidy: + minimum-version: '2.12.0' + ignore-format: + minimum-version: '2.12.0' thread-comments: minimum-version: '2.6.2' required-permission: 'contents: write #thread-comments' @@ -40,6 +44,9 @@ inputs: format-review: minimum-version: '2.9.0' required-permission: 'pull-requests: write #pull-request-reviews' + passive-reviews: + minimum-version: '2.12.0' + required-permission: 'pull-requests: write #pull-request-reviews' jobs: minimum-version: '2.11.0' outputs: diff --git a/docs/permissions.md b/docs/permissions.md index d10163f5..3495c392 100644 --- a/docs/permissions.md +++ b/docs/permissions.md @@ -72,7 +72,7 @@ The [`thread-comments`](inputs-outputs.md#thread-comments) feature requires the ## Pull Request Reviews -The [`tidy-review`](inputs-outputs.md#tidy-review) and [`format-review`](inputs-outputs.md#format-review) features require the following permissions: +The [`tidy-review`](inputs-outputs.md#tidy-review), [`format-review`](inputs-outputs.md#format-review), and [`passive-reviews`](inputs-outputs.md#passive-reviews) features require the following permissions: ```yaml permissions: diff --git a/requirements.txt b/requirements.txt index de7ed9f7..02917bcb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Install clang-tools binaries (clang-format, clang-tidy) # For details please see: https://github.com/cpp-linter/clang-tools-pip -clang-tools==0.12.1 +clang-tools==0.13.0 # cpp-linter core Python executable package # For details please see: https://github.com/cpp-linter/cpp-linter -cpp-linter==1.8.1 +cpp-linter==1.10.0