You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,7 @@ Deployment.
108
108
## Releases
109
109
110
110
### 1.7.0 - XXXX-XX-XX
111
+
- Show some Cppcheck messages (`toomanyconfigs`, `missingInclude`, `noValidConfiguration`) on file-level. See [Known Issues](#known-issues) on how to fix these. (Contribution by @firewave)
Copy file name to clipboardExpand all lines: resources/META-INF/plugin.xml
+1
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@
56
56
]]></description>
57
57
58
58
<change-notes><![CDATA[
59
+
- Show some Cppcheck messages (toomanyconfigs, missingInclude, noValidConfiguration) on file-level. See <a href="https://github.com/johnthagen/clion-cppcheck#known-issues">Known Issues</a> on how to fix these. (Contribution by @firewave)
<error id="toomanyconfigs" severity="information" msg="Too many #ifdef configurations - cppcheck only checks 1 of 12 configurations. Use --force to check all configurations." verbose="The checking of the file will be interrupted because there are too many #ifdef configurations. Checking of all #ifdef configurations can be forced by --force command line option or from GUI preferences. However that may increase the checking time." cwe="398">
<error id="missingIncludeSystem" severity="information" msg="Cppcheck cannot find all the include files (use --check-config for details)" verbose="Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config."/>
@@ -116,11 +106,6 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
116
106
continue;
117
107
}
118
108
119
-
// suppress this warnings for now - will be properly handled in an upcoming patch
120
-
if (id.equals("noValidConfiguration") || id.equals("missingInclude")) {
121
-
continue;
122
-
}
123
-
124
109
// we are never interested in these
125
110
if (id.equals("unmatchedSuppression") || id.equals("purgedConfiguration")) {
126
111
continue;
@@ -148,49 +133,90 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
148
133
}
149
134
}
150
135
136
+
StringfileName = null;
137
+
intlineNumber = 0;
138
+
intcolumn = 0;
139
+
140
+
/*
141
+
<error id="missingInclude" severity="information" msg="Cppcheck cannot find all the include files (use --check-config for details)" verbose="Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config."/>
142
+
*/
143
+
// TODO: handle like any warning when Cppcheck provides the --check-config results with the normal analysis
144
+
if (id.equals("missingInclude")) {
145
+
// is a global warning without location information
146
+
}
151
147
// ignore entries without location e.g. missingIncludeSystem
152
-
if (location == null) {
148
+
elseif (location == null) {
153
149
CppcheckNotification.send("no location for " + psiFile.getVirtualFile().getCanonicalPath(),
// If a file #include's header files, Cppcheck will also run on the header files and print
167
+
// any errors. These errors don't apply to the current file and should not be drawn. They can
168
+
// be distinguished by checking the file name.
169
+
if (!fileName.equals(sourceFileName)) {
170
+
continue;
171
+
}
168
172
}
169
173
170
-
// If a file #include's header files, Cppcheck will also run on the header files and print
171
-
// any errors. These errors don't apply to the current file and should not be drawn. They can
172
-
// be distinguished by checking the file name.
173
-
if (!fileName.equals(sourceFileName)) {
174
-
continue;
175
-
}
174
+
// leaving it at null will report it for the whole file
175
+
TextRangerange = null;
176
176
177
-
// Cppcheck error
178
-
if (lineNumber <= 0 || lineNumber > document.getLineCount()) {
177
+
/*
178
+
<error id="toomanyconfigs" severity="information" msg="Too many #ifdef configurations - cppcheck only checks 1 of 12 configurations. Use --force to check all configurations." verbose="The checking of the file will be interrupted because there are too many #ifdef configurations. Checking of all #ifdef configurations can be forced by --force command line option or from GUI preferences. However that may increase the checking time." cwe="398">
// TODO: handle like any warning when Cppcheck provides the --check-config results with the normal analysis
186
+
elseif (id.equals("missingInclude")) {
187
+
// show as message for the file
188
+
}
189
+
/*
190
+
<error id="noValidConfiguration" severity="information" msg="This file is not analyzed. Cppcheck failed to extract a valid configuration. Use -v for more details." verbose="This file is not analyzed. Cppcheck failed to extract a valid configuration. The tested configurations have these preprocessor errors:\012'' : [/mnt/s/GitHub/cppcheck-fw/gui/temp/moc_platforms.cpp:13] #error "The header file 'platforms.h' doesn't include <QObject>."\012Q_MOC_OUTPUT_REVISION : [/mnt/s/GitHub/cppcheck-fw/gui/temp/moc_platforms.cpp:15] #error "This file was generated using the moc from 5.12.5. It"">
0 commit comments