Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added man/images/ide-clion-configuration-misra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-clion-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-clion-file-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-clion-plugins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-clion-warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-help-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-marketplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-preferences.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-problems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-project-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-project-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-eclipse-window-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vs-external-tool-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vs-external-tool-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vs-external-tools-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vs-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vs-tools-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vscode-install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vscode-settings-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vscode-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/ide-vscode-warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 151 additions & 0 deletions man/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,157 @@ To see all options, run:

python3 reports/explorer/report.py -h

# IDE integration

## Visual Studio Code

Install the extension "Cppcheck Official":

![Installing the Cppcheck Official extension](images/ide-vscode-install.png)

Click on the "gearwheel" to open a popup menu. Click on "Settings":

![Opening the extension settings](images/ide-vscode-settings-menu.png)

Enable Cppcheck and set its path:

![Cppcheck Official settings](images/ide-vscode-settings.png)

If you want to pass extra options to Cppcheck, you can use the "Arguments" option.

::: {.content-visible when-profile="premium"}

For instance, premium options such as a coding standard can be configured with the "Arguments" option.

:::

You can now switch to the editor and write code. Cppcheck is executed when you save. In the screenshot
below we have written the faulty code `int x = 1000 / 0;`:

![Cppcheck warnings in Visual Studio Code](images/ide-vscode-warning.png)

## Visual Studio - External tool

Open "External Tools..." in the "Tools" menu:

![The Tools menu in Visual Studio](images/ide-vs-external-tools-menu.png)

Add a "Cppcheck File" command:

![Adding a "Cppcheck File" command](images/ide-vs-external-tool-file.png){width=50%}

- Title: anything you like, for instance `Cppcheck File`
- Command: the path to the Cppcheck executable, for instance `C:\Program Files\Cppcheck\cppcheck.exe`
- Arguments:

```
--enable=style -q --template=vs "$(ItemPath)"
```

- Ensure that "Use Output window" is selected.

Add a "Cppcheck Project" command:

![Adding a "Cppcheck Project" command](images/ide-vs-external-tool-project.png){width=50%}

- Title: anything you like, for instance `Cppcheck Project`
- Command: the path to the Cppcheck executable, for instance `C:\Program Files\Cppcheck\cppcheck.exe`
- Arguments:

```
--enable=style -j12 -q --template=vs --project="$(ProjectDir)$(ProjectFileName)"
```

- Modify `-j12` so that the desired number of threads is used.
- Ensure that "Use Output window" is selected.

With these arguments Cppcheck will analyze the current vcxproj project.

In both commands you can add arbitrary extra arguments, for instance `--library=..`, `--platform=..`
or `--inconclusive`.

::: {.content-visible when-profile="premium"}

For Cppcheck Premium the command is typically `C:\Program Files\Cppcheck Premium\cppcheck.exe`, and
you can add `--premium=..` options to the arguments.

:::

You can now execute "Cppcheck File" and "Cppcheck Project" in the "Tools" menu:

![Executing Cppcheck from the Tools menu](images/ide-vs-tools-menu.png)

The warnings are shown in the Output window at the bottom of the screen. You can double click on a
warning to open the location in the editor.

![Cppcheck warnings in the Output window](images/ide-vs-output.png)

## Eclipse-based IDEs

In the "Help" menu, click on "Eclipse Marketplace...":

![The Help menu in Eclipse](images/ide-eclipse-help-menu.png)

Install the "cppcheclipse" plugin:

![Installing cppcheclipse](images/ide-eclipse-marketplace.png){width=55%}

Open the "Window" menu and click on "Preferences":

![The Window menu in Eclipse](images/ide-eclipse-window-menu.png)

Configure the path to the Cppcheck executable:

![cppcheclipse preferences](images/ide-eclipse-preferences.png)

Adjust the cppcheclipse options in the project properties. Open the "Project" menu and click on
"Properties":

![The Project menu in Eclipse](images/ide-eclipse-project-menu.png)

![cppcheclipse project properties](images/ide-eclipse-project-properties.png){width=70%}

Problems will be shown in the editor:

![Cppcheck warnings in Eclipse](images/ide-eclipse-problems.png)

::: {.content-visible when-profile="premium"}

In the above screenshot Misra C 2023 is enabled in the project properties, and there are Misra
violations on line 2 and 6.

:::

## CLion

Open "Settings..." in the "File" menu:

![The File menu in CLion](images/ide-clion-file-menu.png){width=40%}

In the settings dialog, browse to "Plugins" and install the "cppcheck" plugin:

![Installing the cppcheck plugin](images/ide-clion-plugins.png)

After installing the plugin, edit the "Cppcheck Configuration". Set the "Cppcheck Path" and the
"Cppcheck Options":

![Cppcheck Configuration](images/ide-clion-configuration.png)

::: {.content-visible when-profile="premium"}

For instance, to enable Misra C++ 2023 add the option `--premium=misra-c++-2023`:

![Cppcheck Configuration with Misra C++ 2023](images/ide-clion-configuration-misra.png)

The CLion Cppcheck plugin does not handle the Cppcheck safety certified behavior well, therefore
also add the option `--premium=safety-off`.

:::

Cppcheck warnings are now shown in the editor:

![Cppcheck warnings in CLion](images/ide-clion-warning.png)

# Check level

## Reduced
Expand Down
Loading