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
Github Actions for linting the C/C++ code. Uses clang-tidy, clang-format, and cppcheck.
3
+
Github Actions for linting the C/C++ code. Integrated clang-tidy, clang-format, and Cppcheck checks.
4
4
5
5
## Integration with GitHub Actions
6
6
7
-
For example, create a `.yml` file like `.github/workflows/cpp-linter.yml`.
7
+
Just create a `yml` file under your GitHub repository. For example `.github/workflows/cpp-linter.yml`
8
8
9
-
```
9
+
```yml
10
10
name: cpp-linter
11
11
12
12
on: [pull_request]
@@ -17,14 +17,20 @@ jobs:
17
17
steps:
18
18
- name: cpp-linter
19
19
uses: shenxianpeng/cpp-linter-action@master
20
+
with:
21
+
fetch-depth: 0
20
22
env:
21
23
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22
24
```
25
+
23
26
## Results of GitHub Actions
24
27
25
-
This one has a test repository:[cpp-linter-action-demo](https://github.com/shenxianpeng/cpp-linter-action-demo)
28
+
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.
26
29
27
-
You can feel free to commit C/C++ code and then see the actual results via Pull Request. such as this PR [#3](https://github.com/shenxianpeng/cpp-linter-action-demo/pull/3)
30
+
For example, this PR [#6](https://github.com/shenxianpeng/cpp-linter-action-demo/pull/6), and warning message like below:
Please feel free to commit code to the [demo](https://github.com/shenxianpeng/cpp-linter-action-demo) repo and create a Pull Request to see how the process works.
35
+
36
+
If you have any suggestions or contributions, welcome to PR [here](https://github.com/shenxianpeng/cpp-linter-action).
0 commit comments