Skip to content
Merged
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ This extension contributes the following settings under `cppcheck-official.*`:

- **`cppcheck-official.enable`**: (boolean) Enable or disable the extension.
- **`cppcheck-official.minSeverity`**: (string) Minimum severity to report (`info`, `warning`, or `error`). `info` shows style, performance, portability and information messages.
- **`cppcheck-official.standard`**: (string) Sets the C/C++ standard with `--std=<id>` (e.g. `c11`, `c++17`).
- **`cppcheck-official.arguments`**: (string) Additional [command line arguments](https://cppcheck.sourceforge.io/manual.pdf?#page=5) to pass to `cppcheck`.
- **`cppcheck-official.path`**: (string) Path to the `cppcheck` executable. If left empty, `cppcheck` from the system PATH is used. Supports paths relative to workspace folder on the formats `./RELATIVE_PATH`, `../RELATIVE_PATH` or `${workspaceFolder}/RELATIVE_PATH`.

Expand Down
6 changes: 0 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export function activate(context: vscode.ExtensionContext) {
const isEnabled = config.get<boolean>("cppcheck-official.enable", true);
const extraArgs = config.get<string>("cppcheck-official.arguments", "");
const minSevString = config.get<string>("cppcheck-official.minSeverity", "info");
const standard = config.get<string>("cppcheck-official.standard", "c++20");
const userPath = config.get<string>("cppcheck-official.path")?.trim() || "";
const commandPath = userPath ? resolvePath(userPath) : "cppcheck";

Expand All @@ -139,7 +138,6 @@ export function activate(context: vscode.ExtensionContext) {
commandPath,
extraArgs,
minSevString,
standard,
diagnosticCollection
);
}
Expand Down Expand Up @@ -190,7 +188,6 @@ async function runCppcheckOnFileXML(
commandPath: string,
extraArgs: string,
minSevString: string,
standard: string,
diagnosticCollection: vscode.DiagnosticCollection
): Promise<void> {
// Clear existing diagnostics for this file
Expand All @@ -199,7 +196,6 @@ async function runCppcheckOnFileXML(
// Replace backslashes (used in paths in Windows environment)
const filePath = document.fileName.replaceAll('\\', '/');
const minSevNum = parseMinSeverity(minSevString);
const standardArg = standard !== "<none>" ? `--std=${standard}` : "";

// Resolve paths for arguments where applicable
const extraArgsParsed = (extraArgs.split(" ")).map((arg) => {
Expand All @@ -220,7 +216,6 @@ async function runCppcheckOnFileXML(
'--suppress=missingInclude',
'--suppress=missingIncludeSystem',
`--file-filter=${filePath}`,
standardArg,
...extraArgsParsed,
].filter(Boolean);
proc = cp.spawn(commandPath, args, {
Expand All @@ -234,7 +229,6 @@ async function runCppcheckOnFileXML(
'--suppress=unusedFunction',
'--suppress=missingInclude',
'--suppress=missingIncludeSystem',
standardArg,
...extraArgsParsed,
filePath,
].filter(Boolean);
Expand Down