1
1
<!-- markdownlint-disable MD041 -->
2
+
3
+ [ file-annotations ] : https://cpp-linter.github.io/cpp_linter_rs/cli#-a---file-annotations
4
+ [ thread-comments ] : https://cpp-linter.github.io/cpp_linter_rs/cli#-g---thread-comments
5
+ [ step-summary ] : https://cpp-linter.github.io/cpp_linter_rs/cli#-w---step-summary
6
+ [ tidy-review ] : https://cpp-linter.github.io/cpp_linter_rs/cli#-d---tidy-review
7
+ [ format-review ] : https://cpp-linter.github.io/cpp_linter_rs/cli#-m---format-review
8
+
9
+ [ format-annotations-preview ] : docs/src/images/annotations-clang-format.png
10
+ [ tidy-annotations-preview ] : docs/src/images/annotations-clang-tidy.png
11
+ [ step-summary-preview ] : docs/src/images/step-summary.png
12
+ [ thread-comment-preview ] : docs/src/images/comment.png
13
+ [ tidy-review-preview ] : docs/src/images/tidy-review.png
14
+ [ format-review-preview ] : docs/src/images/format-review.png
15
+ [ format-suggestion-preview ] : docs/src/images/format-suggestion.png
16
+
2
17
[ ![ Python packaging] [ py-build-badge ]] [ py-build-ci ]
3
18
[ ![ Binary executable builds] [ bin-build-badge ]] [ bin-build-ci ]
4
19
[ ![ node-js builds] [ node-ci-badge ]] [ node-ci ]
5
20
[ ![ Test CI] [ test-ci-badge ]] [ test-ci ]
6
21
[ ![ Docs] [ docs-ci-badge ]] [ docs-site ]
7
22
[ ![ Pre-commit-ci] [ pre-commit-badge ]] [ pre-commit-ci ]
8
-
9
23
[ ![ codecov-status] [ codecov-badge ]] [ codecov-project ]
10
- [ ![ docs.rs] [ docs-rs-badge ]] [ docs-rs ]
11
- [ ![ PyPI - Version] [ pypi-badge ]] [ pypi-pkg ]
12
- [ ![ Crates.io Version] [ crates-io-badge ]] [ crates-io-pkg ]
13
- [ ![ NPM Version] [ npm-badge ]] [ npm-pkg ]
14
24
15
25
[ py-build-ci ] : https://github.com/cpp-linter/cpp_linter_rs/actions/workflows/python-packaging.yml
16
26
[ py-build-badge ] : https://github.com/cpp-linter/cpp_linter_rs/actions/workflows/python-packaging.yml/badge.svg
30
40
[ docs-rs ] : https://docs.rs/cpp-linter
31
41
[ pypi-badge ] : https://img.shields.io/pypi/v/cpp-linter
32
42
[ pypi-pkg ] : https://pypi.org/project/cpp-linter/
43
+ [ test-pypi-badge ] : https://img.shields.io/pypi/v/cpp-linter?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org&label=test-pypi
44
+ [ test-pypi-pkg ] : https://test.pypi.org/project/cpp-linter/
33
45
[ crates-io-badge ] : https://img.shields.io/crates/v/cpp-linter
34
46
[ crates-io-pkg ] : https://crates.io/crates/cpp-linter
35
47
[ npm-badge ] : https://img.shields.io/npm/v/%40cpp-linter%2Fcpp-linter
36
48
[ npm-pkg ] : https://www.npmjs.com/package/@cpp-linter/cpp-linter
37
49
38
50
# C/C++ Linting Package
39
51
40
- A Python and Rust package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments, step summary, or file annotations.
52
+ A package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of
53
+
54
+ - [x] [ thread-comments] ( #thread-comment )
55
+ - [x] [ step-summary] ( #step-summary )
56
+ - [x] [ file-annotations] ( #annotations )
57
+ - [x] [ Pull Request Review] ( #pull-request-review ) suggestions
41
58
42
59
> [ !CAUTION]
43
60
> This project is still experimental and subject to drastic changes.
44
- > Please use the pure python [ cpp-linter] ( https://github.com/cpp-linter/cpp-linter )
61
+ > Please use the [ pure python cpp-linter] ( https://github.com/cpp-linter/cpp-linter )
45
62
> package until this project is ready for deployment.
46
63
64
+ ## Install
65
+
66
+ This package is available in several programming languages (through their respective package managers).
67
+
68
+ ### Rust
69
+
70
+ [ ![ Crates.io Version] [ crates-io-badge ]] [ crates-io-pkg ]
71
+ [ ![ docs.rs] [ docs-rs-badge ]] [ docs-rs ]
72
+
73
+ Install from source code hosted at crates.io:
74
+
75
+ ``` text
76
+ cargo install cpp-linter
77
+ ```
78
+
79
+ Install a pre-compiled binary from GitHub releases:
80
+
81
+ First [ install ` cargo-binstall ` ] ( https://github.com/cargo-bins/cargo-binstall?tab=readme-ov-file#installation ) .
82
+
83
+ ``` text
84
+ cargo binstall cpp-linter
85
+ ```
86
+
87
+ ### Python
88
+
89
+ [ ![ PyPI - Version] [ pypi-badge ]] [ pypi-pkg ]
90
+
91
+ Install the python package:
92
+
93
+ ``` text
94
+ pip install cpp-linter
95
+ ```
96
+
97
+ [ ![ testPyPI - Version] [ test-pypi-badge ]] [ test-pypi-pkg ]
98
+
99
+ Pre-releases are uploaded to test-pypi:
100
+
101
+ ``` text
102
+ pip install -i https://test.pypi.org/simple/ cpp-linter
103
+ ```
104
+
105
+ ### Node.js
106
+
107
+ [ ![ NPM Version] [ npm-badge ]] [ npm-pkg ]
108
+
109
+ Install the Node.js binding:
110
+
111
+ ``` text
112
+ npm -g install @cpp-linter/cpp-linter
113
+ ```
114
+
47
115
## Usage
48
116
49
117
For usage in a CI workflow, see
@@ -52,56 +120,103 @@ For usage in a CI workflow, see
52
120
For the description of supported Command Line Interface options, see
53
121
[ the CLI documentation] ( https://cpp-linter.github.io/cpp_linter_rs/cli.html ) .
54
122
123
+ ## Example
124
+
125
+ ### Annotations
126
+
127
+ Using [ ` --file-annotations ` ] [ file-annotations ] :
128
+
129
+ #### clang-format annotations
130
+
131
+ ![ clang-format annotations] [ format-annotations-preview ]
132
+
133
+ #### clang-tidy annotations
134
+
135
+ ![ clang-tidy annotations] [ tidy-annotations-preview ]
136
+
137
+ ### Thread Comment
138
+
139
+ Using [ ` --thread-comments ` ] [ thread-comments ] :
140
+
141
+ ![ sample thread-comment] [ thread-comment-preview ]
142
+
143
+ ### Step Summary
144
+
145
+ Using [ ` --step-summary ` ] [ step-summary ] :
146
+
147
+ ![ step summary] [ step-summary-preview ]
148
+
149
+ ### Pull Request Review
150
+
151
+ #### Only clang-tidy
152
+
153
+ Using [ ` --tidy-review ` ] [ tidy-review ] :
154
+
155
+ ![ sample tidy-review] [ tidy-review-preview ]
156
+
157
+ #### Only clang-format
158
+
159
+ Using [ ` --format-review ` ] [ format-review ] :
160
+
161
+ ![ sample format-review] [ format-review-preview ]
162
+
163
+ ![ sample format-suggestion] [ format-suggestion-preview ]
164
+
55
165
## Have question or feedback?
56
166
57
167
To provide feedback (requesting a feature or reporting a bug) please post to
58
168
[ issues] ( https://github.com/cpp-linter/cpp_linter_rs/issues ) .
59
169
60
170
## License
61
171
62
- The scripts and documentation in this project are released under the [ MIT] [ MIT ] .
172
+ The scripts and documentation in this project are released under the [ MIT] .
63
173
64
174
Dependencies (that are redistributed by us in binary form) have the following
65
175
license agreements:
66
176
67
177
- [ clap] ( https://crates.io/crates/clap ) :
68
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
178
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
69
179
- [ git2] ( https://crates.io/crates/git2 ) :
70
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
180
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
71
181
72
182
The following are conditionally included in binaries (using the ` openssl-vendored ` feature on a
73
183
case-by-case basis) because it is a dependency of git2:
74
184
75
185
- [ openssl] ( https://crates.io/crates/openssl ) : Licensed under [ Apache 2.0] [ Apache2 ]
76
186
- [ openssl-probe] ( https://crates.io/crates/openssl-probe ) :
77
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
187
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
78
188
79
189
- [ lenient_semver] ( https://crates.io/crates/lenient_semver ) :
80
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
190
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
81
191
- [ log] ( https://crates.io/crates/log ) :
82
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
192
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
83
193
- [ regex] ( https://crates.io/crates/regex ) :
84
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
194
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
85
195
- [ reqwest] ( https://crates.io/crates/reqwest ) :
86
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
196
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
87
197
- [ semver] ( https://crates.io/crates/semver ) :
88
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
198
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
89
199
- [ serde] ( https://crates.io/crates/serde ) :
90
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
91
- - [ serde-xml-rs] ( https://crates.io/crates/serde-xml-rs ) : Licensed under [ MIT] [ MIT ] .
200
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
201
+ - [ serde-xml-rs] ( https://crates.io/crates/serde-xml-rs ) : Licensed under [ MIT] .
92
202
- [ serde_json] ( https://crates.io/crates/serde_json ) :
93
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
94
- - [ which] ( https://crates.io/crates/which ) : Licensed under [ MIT] [ MIT ] .
95
- - [ tokio] ( https://crates.io/crates/tokio ) : Licensed under [ MIT] [ MIT ] .
203
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
204
+ - [ which] ( https://crates.io/crates/which ) : Licensed under [ MIT] .
205
+ - [ tokio] ( https://crates.io/crates/tokio ) : Licensed under [ MIT] .
96
206
- [ futures] ( https://crates.io/crates/futures ) :
97
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
207
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
98
208
- [ chrono] ( https://crates.io/crates/chrono ) :
99
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
209
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
100
210
101
211
The python binding uses
102
212
103
213
- [ pyo3] ( https://crates.io/crates/pyo3 ) :
104
- Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] [ MIT ] .
214
+ Dual-licensed under [ Apache 2.0] [ Apache2 ] or [ MIT] .
215
+
216
+ The node binding uses
217
+
218
+ - [ napi] ( https://crates.io/crates/napi ) : Licensed under [ MIT]
219
+ - [ napi-derive] ( https://crates.io/crates/napi-derive ) : Licensed under [ MIT]
105
220
106
221
[ MIT ] : https://choosealicense.com/licenses/mit
107
222
[ Apache2 ] : https://choosealicense.com/licenses/apache-2.0/
0 commit comments