Skip to content

Commit 46a0016

Browse files
author
shenxianpeng
committed
Update README.md
1 parent 0dedcbb commit 46a0016

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# cpp-linter-action
22

3-
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.
44

55
## Integration with GitHub Actions
66

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`
88

9-
```
9+
```yml
1010
name: cpp-linter
1111

1212
on: [pull_request]
@@ -17,14 +17,20 @@ jobs:
1717
steps:
1818
- name: cpp-linter
1919
uses: shenxianpeng/cpp-linter-action@master
20+
with:
21+
fetch-depth: 0
2022
env:
2123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2224
```
25+
2326
## Results of GitHub Actions
2427
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.
2629

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:
2831

2932
![github-actions bot](https://github.com/shenxianpeng/cpp-linter-action-demo/blob/master/img/result.png?raw=true)
3033

34+
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).

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: C/C++ code linter (clang-tidy, clang-format, and cppcheck)
2-
description: Automatically checks pull requests changes with clang-tidy, clang-format, and cppcheck and posts the comment with result.
1+
name: C/C++ code linter (clang-tidy, clang-format, and Cppcheck)
2+
description: Automatically checks pull requests changes with clang-tidy, clang-format, and Cppcheck and posts the comment with result.
33
author: shenxianpeng
44
branding:
55
icon: alert-circle

0 commit comments

Comments
 (0)