Skip to content

Bump cpp-linter from 1.6.5 to 1.7.1 #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ jobs:

#### `verbosity`

- **Description**: This controls the action's verbosity in the workflow's logs. Supported options are defined by the [python logging library's log levels](https://docs.python.org/3/library/logging.html#logging-levels). This option does not affect the verbosity of resulting thread comments or file annotations.
- Default: '10'
- **Description**: This controls the action's verbosity in the workflow's logs. Supported options are `info` or `debug`. This option does not affect the verbosity of resulting thread comments or file annotations.
- The verbosity can also be engaged by enabling debug logs when [re-running jobs or workflows](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs).
- Default: 'info'

#### `lines-changed-only`

Expand Down Expand Up @@ -168,6 +169,24 @@ jobs:
- **Description**: A string of extra arguments passed to clang-tidy for use as compiler arguments (like `-std=c++14 -Wall`).
- Default: ''

#### `tidy-review`

**Beta feature** 🚧

- **Description**: Set this option to true to enable pull request reviews from clang-tidy.
- To use Pull Request reviews, the `GITHUB_TOKEN` (provided by Github to each repository) must be declared as an environment
variable. See [Authenticating with the GITHUB_TOKEN](https://docs.github.com/en/actions/reference/authentication-in-a-workflow)
- See also [the PR review feature caveats](https://cpp-linter.github.io/cpp-linter/pr_review_caveats.html)
- Default: false

#### `format-review`

- **Description**: Set this option to true to enable pull request reviews from clang-format.
- To use Pull Request reviews, the `GITHUB_TOKEN` (provided by Github to each repository) must be declared as an environment
variable. See [Authenticating with the GITHUB_TOKEN](https://docs.github.com/en/actions/reference/authentication-in-a-workflow)
- See also [the PR review feature caveats](https://cpp-linter.github.io/cpp-linter/pr_review_caveats.html)
- Default: false

### Outputs

This action creates 3 output variables. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's outputs to exit the workflow early if that is desired.
Expand Down Expand Up @@ -202,6 +221,18 @@ The total number of concerns raised by clang-format only.

![step summary](https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/step-summary.png)

### Pull Request Review

Using only clang-tidy (`tidy-review`):

![sample tidy-review](https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/tidy-review.png)

Using only clang-format (`format-review`):

![sample format-review](https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-review.png)

![sample tidy-review](https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-suggestion.png)

<!--footer-start-->

## Add C/C++ Linter Action badge in README
Expand Down
20 changes: 16 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ inputs:
required: false
default: "12"
verbosity:
description: A hidden option to control the action's log verbosity. This is the `logging` level (defaults to DEBUG).
description: A hidden option to control the action's log verbosity. This is the `logging` level (defaults to `info`).
required: false
default: "10"
default: info
lines-changed-only:
description: Set this option to 'true' to only analyze changes in the event's diff. Defaults to 'false'.
required: false
Expand Down Expand Up @@ -99,6 +99,14 @@ inputs:
description: A string of extra arguments passed to clang-tidy for use as compiler arguments. Multiple arguments are separated by spaces so the argument name and value should use an '=' sign instead of a space.
required: false
default: ""
tidy-review:
description: Set this to true to enable PR reviews from clang-tidy. See also https://cpp-linter.github.io/cpp-linter/pr_review_caveats.html
required: false
default: false
format-review:
description: Set this to true to enable PR reviews from clang-format.See also https://cpp-linter.github.io/cpp-linter/pr_review_caveats.html
required: false
default: false
outputs:
checks-failed:
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy and clang-format.
Expand Down Expand Up @@ -166,7 +174,9 @@ runs:
--ignore="${{ inputs.ignore }}" \
--database=${{ inputs.database }} \
--file-annotations=${{ inputs.file-annotations }} \
--extra-arg="${{ inputs.extra-args }}"
--extra-arg="${{ inputs.extra-args }}" \
--tidy-review="${{ inputs.tidy-review }}" \
--format-review="${{ inputs.format-review }}"

- name: Setup python venv (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -199,6 +209,8 @@ runs:
' --ignore="${{ inputs.ignore }}"' +
' --database=${{ inputs.database }}' +
' --file-annotations=${{ inputs.file-annotations }}' +
' --extra-arg="${{ inputs.extra-args }}"'
' --extra-arg="${{ inputs.extra-args }}"' +
' --tidy-review="${{ inputs.tidy-review }}"' +
' --format-review="${{ inputs.format-review }}"'

Invoke-Expression -Command $app
Binary file added docs/images/format-review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/format-suggestion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tidy-review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ clang-tools==0.11.1

# cpp-linter core Python executable package
# For details please see: https://github.com/cpp-linter/cpp-linter
cpp-linter==1.6.5
cpp-linter==1.7.1