Skip to content

Commit 952be34

Browse files
shenxianpeng2bndy5
andauthored
support new extra-args option (#104)
* Support new extra-args option * Update action.yml Co-authored-by: Brendan <[email protected]> * Update action.yml Co-authored-by: Brendan <[email protected]> * Update action.yml and README.md Co-authored-by: Brendan <[email protected]>
1 parent 8d99b60 commit 952be34

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ jobs:
139139
- **Description**: The directory containing compilation database (like compile_commands.json) file.
140140
- Default: ''
141141

142+
#### `extra-args`
143+
144+
- **Description**: A string of extra arguments passed to clang-tidy for use as compiler arguments (like `-std=c++14 -Wall`).
145+
- Default: ''
146+
142147
### Outputs
143148

144149
This action creates 1 output variable named `checks-failed`. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's output to exit the workflow early if that is desired.

action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ inputs:
4141
required: false
4242
default: "12"
4343
verbosity:
44-
description: A hidden option to control the action's log verbosity. This is the `logging` level (degaults to DEBUG)
44+
description: A hidden option to control the action's log verbosity. This is the `logging` level (defaults to DEBUG).
4545
required: false
4646
default: "10"
4747
lines-changed-only:
48-
description: Set this option to 'true' to only analyse changes in the event's diff. Defaults to 'false'.
48+
description: Set this option to 'true' to only analyze changes in the event's diff. Defaults to 'false'.
4949
required: false
5050
default: false
5151
files-changed-only:
52-
description: Set this option to 'false' to analyse any source files in the repo. Defaults to 'true'.
52+
description: Set this option to 'false' to analyze any source files in the repo. Defaults to 'true'.
5353
required: false
5454
default: true
5555
ignore:
@@ -74,6 +74,10 @@ inputs:
7474
description: The directory containing compile_commands.json file.
7575
required: false
7676
default: ""
77+
extra-args:
78+
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.
79+
required: false
80+
default: ""
7781
outputs:
7882
checks-failed:
7983
description: An integer that can be used as a boolean value to indicate if all checks failed.
@@ -83,7 +87,7 @@ runs:
8387
steps:
8488
- name: Install action dependencies
8589
shell: bash
86-
run: python3 -m pip install clang-tools cpp-linter
90+
run: python3 -m pip install clang-tools cpp-linter==1.4.7
8791
- name: Install clang-tools binary executables
8892
shell: bash
8993
run: clang-tools -i ${{ inputs.version }} -b
@@ -103,4 +107,5 @@ runs:
103107
--thread-comments=${{ inputs.thread-comments }} \
104108
--ignore="${{ inputs.ignore }}" \
105109
--database=${{ inputs.database }} \
106-
--file-annotations=${{ inputs.file-annotations }}
110+
--file-annotations=${{ inputs.file-annotations }} \
111+
--extra-arg="${{ inputs.extra-args }}"

0 commit comments

Comments
 (0)