|
1 | 1 | # Cppcheck Official |
2 | 2 |
|
| 3 | + |
3 | 4 | **Cppcheck Official** is a Visual Studio Code extension that runs [cppcheck](https://cppcheck.sourceforge.io/) against C/C++ files upon save and reports any warnings or errors in the Problems panel. |
4 | 5 |
|
| 6 | + |
| 7 | + |
5 | 8 | ## Features |
6 | 9 |
|
7 | 10 | - **On-save linting**: When you save a c/cpp file, `cppcheck` is automatically run on that file. |
8 | 11 | - **Per-file diagnostics**: Only diagnostics relevant to the saved file are displayed. |
9 | 12 | - **Configurable severity threshold**: Filter out messages below a chosen severity level (`info`, `warning`, or `error`). |
10 | | -- **Set C/C++ standard**: Easily specify `--std=<id>` (e.g. `c++17`, `c99`, etc.). |
11 | 13 | - **Diagnostic cleanup**: When you close a file, its diagnostics are automatically cleared. |
12 | | -- **Project file support**: You can feed your project file to cppcheck through the `--project` flag in the `cppcheck-official.arguments` field in the extension settings. |
| 14 | +- **Project file support**: You can feed your project file to cppcheck through the `--project` flag in the `cppcheck-official.arguments` field in the extension settings. (See GIF below) |
| 15 | + |
13 | 16 | - **Warning notes**: Display notes for warnings when those are available |
| 17 | +- **Warning type suppression**: Suppress warnings with comments on the form `// cppcheck suppress >warning type<`. Cppcheck also warns about unmatched suppressions. |
| 18 | + |
14 | 19 |
|
15 | 20 | ## Requirements |
16 | 21 |
|
17 | 22 | **Cppcheck** must be installed on your system. |
18 | 23 | - By default, this extension looks for `cppcheck` on the system PATH. |
19 | 24 | - Alternatively, specify a custom executable path using the `cppcheck-official.path` setting. |
20 | 25 |
|
| 26 | + |
| 27 | + |
21 | 28 | Examples of installing Cppcheck: |
22 | 29 | - On Linux (Debian/Ubuntu), install via `sudo apt-get install cppcheck`. |
23 | 30 | - On macOS with Homebrew: `brew install cppcheck`. |
|
0 commit comments