You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,10 @@ Just create a `yml` file under your GitHub repository. For example `.github/work
12
12
name: cpp-linter
13
13
14
14
# Triggers the workflow on push or pull request events
15
-
on: [push, pull_request]
15
+
on:
16
+
push:
17
+
pull_request:
18
+
types: [opened]
16
19
jobs:
17
20
cpp-linter:
18
21
name: cpp-linter
@@ -31,25 +34,24 @@ jobs:
31
34
|------------|---------------|-------------|
32
35
| style | 'llvm' | The style rules to use. Set this to 'file' to have clang-format use the closest relative .clang-format file. |
33
36
| extensions | 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx' | The file extensions to run the action against. This is a comma-separated string. |
34
-
| tidy-checks | 'boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*' | A string of regex-like patterns specifying what checks clang-tidy will use.|
37
+
| tidy-checks | 'boost-\*,bugprone-\*,performance-\*,<br>readability-\*,portability-\*,<br>modernize-\*,clang-analyzer-\*,<br>cppcoreguidelines-\*' | A string of regex-like patterns specifying what checks clang-tidy will use.|
35
38
| repo-root | '.' | The relative path to the repository root directory. This path is relative to path designated by the runner's GITHUB_WORKSPACE environment variable. |
36
39
| version | '10' | The desired version of the clang tools to use. Accepted options are strings which can be 6.0, 7, 8, 9, 10, 11, 12. |
37
40
38
41
### Outputs
39
42
40
43
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.
41
44
42
-
### Outputs
43
-
44
-
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.
45
45
## Results of GitHub Actions
46
46
47
-
Here is a test repository [cpp-linter-action-demo](https://github.com/shenxianpeng/cpp-linter-action-demo) which has added `cpp-linter.yml`. when an unformatted C/C++ source file was committed and create a Pull Request will automatically recognize and add warning comments.
47
+

48
+
49
+
Behind the scenes, this is because this repository has added `test.yml` under `.github/workflows/`. When an unformatted C/C++ source file was committed and create a Pull Request will automatically recognize and add warning comments.
48
50
49
-
For example, this PR [#7](https://github.com/shenxianpeng/cpp-linter-action-demo/pull/7), and warning message like below:
51
+
Please feel free to commit code to the `test` branch of this repository or create a Pull Request to see how the process works.
For example, this test PR [#6](https://github.com/shenxianpeng/cpp-linter-action/pull/5) and github-actions bot comments [link](https://github.com/shenxianpeng/cpp-linter-action/pull/5#commitcomment-55252014).
52
54
53
-
Please feel free to commit code to the [demo](https://github.com/shenxianpeng/cpp-linter-action-demo) repository and create a Pull Request to see how the process works.
55
+
## Contribution
54
56
55
57
If you have any suggestions or contributions, welcome to PR [here](https://github.com/shenxianpeng/cpp-linter-action).
0 commit comments