cppcheck-py 2.19.0__py3-none-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cppcheck/__init__.py +55 -0
- cppcheck/cppcheck-2.19.0.tar.gz +0 -0
- cppcheck/data/addons/__init__.py +0 -0
- cppcheck/data/addons/cppcheck.py +41 -0
- cppcheck/data/addons/cppcheckdata.py +1727 -0
- cppcheck/data/addons/findcasts.py +32 -0
- cppcheck/data/addons/misc.py +163 -0
- cppcheck/data/addons/misra.py +5153 -0
- cppcheck/data/addons/misra_9.py +559 -0
- cppcheck/data/addons/naming.py +92 -0
- cppcheck/data/addons/namingng.py +420 -0
- cppcheck/data/addons/runaddon.py +16 -0
- cppcheck/data/addons/threadsafety.py +350 -0
- cppcheck/data/addons/y2038.py +602 -0
- cppcheck/data/cfg/avr.cfg +402 -0
- cppcheck/data/cfg/bento4.cfg +142 -0
- cppcheck/data/cfg/boost.cfg +1284 -0
- cppcheck/data/cfg/bsd.cfg +567 -0
- cppcheck/data/cfg/cairo.cfg +89 -0
- cppcheck/data/cfg/cppcheck-lib.cfg +72 -0
- cppcheck/data/cfg/cppunit.cfg +48 -0
- cppcheck/data/cfg/dpdk.cfg +11 -0
- cppcheck/data/cfg/embedded_sql.cfg +4 -0
- cppcheck/data/cfg/emscripten.cfg +108 -0
- cppcheck/data/cfg/ginac.cfg +12848 -0
- cppcheck/data/cfg/gnu.cfg +1738 -0
- cppcheck/data/cfg/googletest.cfg +62 -0
- cppcheck/data/cfg/gtk.cfg +23082 -0
- cppcheck/data/cfg/icu.cfg +221 -0
- cppcheck/data/cfg/kde.cfg +92 -0
- cppcheck/data/cfg/libcerror.cfg +203 -0
- cppcheck/data/cfg/libcurl.cfg +487 -0
- cppcheck/data/cfg/libsigc++.cfg +36 -0
- cppcheck/data/cfg/lua.cfg +316 -0
- cppcheck/data/cfg/mfc.cfg +271 -0
- cppcheck/data/cfg/microsoft_atl.cfg +40 -0
- cppcheck/data/cfg/microsoft_sal.cfg +490 -0
- cppcheck/data/cfg/microsoft_unittest.cfg +20 -0
- cppcheck/data/cfg/motif.cfg +318 -0
- cppcheck/data/cfg/nspr.cfg +38 -0
- cppcheck/data/cfg/ntl.cfg +6907 -0
- cppcheck/data/cfg/opencv2.cfg +132 -0
- cppcheck/data/cfg/opengl.cfg +581 -0
- cppcheck/data/cfg/openmp.cfg +157 -0
- cppcheck/data/cfg/openssl.cfg +174 -0
- cppcheck/data/cfg/pcre.cfg +165 -0
- cppcheck/data/cfg/posix.cfg +6445 -0
- cppcheck/data/cfg/protobuf.cfg +10 -0
- cppcheck/data/cfg/python.cfg +674 -0
- cppcheck/data/cfg/qt.cfg +5502 -0
- cppcheck/data/cfg/ruby.cfg +142 -0
- cppcheck/data/cfg/sdl.cfg +354 -0
- cppcheck/data/cfg/selinux.cfg +3621 -0
- cppcheck/data/cfg/sfml.cfg +301 -0
- cppcheck/data/cfg/sqlite3.cfg +1571 -0
- cppcheck/data/cfg/std.cfg +9205 -0
- cppcheck/data/cfg/tinyxml2.cfg +37 -0
- cppcheck/data/cfg/vcl.cfg +4 -0
- cppcheck/data/cfg/windows.cfg +17237 -0
- cppcheck/data/cfg/wxsqlite3.cfg +1955 -0
- cppcheck/data/cfg/wxsvg.cfg +16905 -0
- cppcheck/data/cfg/wxwidgets.cfg +17245 -0
- cppcheck/data/cfg/zephyr.cfg +113 -0
- cppcheck/data/cfg/zlib.cfg +1450 -0
- cppcheck/data/cppcheck-htmlreport +1157 -0
- cppcheck/data/cppcheck.exe +0 -0
- cppcheck/data/platforms/aix_ppc64.xml +18 -0
- cppcheck/data/platforms/arm32-wchar_t2.xml +18 -0
- cppcheck/data/platforms/arm32-wchar_t4.xml +18 -0
- cppcheck/data/platforms/arm64-wchar_t2.xml +18 -0
- cppcheck/data/platforms/arm64-wchar_t4.xml +18 -0
- cppcheck/data/platforms/avr8.xml +18 -0
- cppcheck/data/platforms/cray_sv1.xml +18 -0
- cppcheck/data/platforms/elbrus-e1cp.xml +18 -0
- cppcheck/data/platforms/mips32.xml +18 -0
- cppcheck/data/platforms/msp430_eabi_large_datamodel.xml +18 -0
- cppcheck/data/platforms/pic16.xml +18 -0
- cppcheck/data/platforms/pic8-enhanced.xml +18 -0
- cppcheck/data/platforms/pic8.xml +18 -0
- cppcheck_py-2.19.0.dist-info/METADATA +76 -0
- cppcheck_py-2.19.0.dist-info/RECORD +84 -0
- cppcheck_py-2.19.0.dist-info/WHEEL +5 -0
- cppcheck_py-2.19.0.dist-info/entry_points.txt +4 -0
- cppcheck_py-2.19.0.dist-info/licenses/LICENSE.md +191 -0
cppcheck/__init__.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import os
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from importlib.resources import files
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_executable(name: str) -> Path:
|
|
10
|
+
return _get_executable(name)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@functools.cache
|
|
14
|
+
def _get_executable(name: str) -> Path:
|
|
15
|
+
possibles = [
|
|
16
|
+
Path(files("cppcheck") / f"data/{name}{s}")
|
|
17
|
+
for s in ("", ".exe", ".bin", ".dmg")
|
|
18
|
+
]
|
|
19
|
+
for exe in possibles:
|
|
20
|
+
if exe.exists():
|
|
21
|
+
if os.environ.get("CPPCHECK_WHEEL_VERBOSE", None):
|
|
22
|
+
print(f"Found binary: {exe}")
|
|
23
|
+
return exe
|
|
24
|
+
|
|
25
|
+
possibles_str = "\n\t".join(map(str, possibles))
|
|
26
|
+
raise FileNotFoundError(f"No executable found for {name} at\n\t{possibles_str}")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _run(name, *args):
|
|
30
|
+
command = [_get_executable(name)]
|
|
31
|
+
if args:
|
|
32
|
+
command += list(args)
|
|
33
|
+
else:
|
|
34
|
+
command += sys.argv[1:]
|
|
35
|
+
return subprocess.call(command)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _run_python(name, *args):
|
|
39
|
+
command = [sys.executable, _get_executable(name)]
|
|
40
|
+
if args:
|
|
41
|
+
command += list(args)
|
|
42
|
+
else:
|
|
43
|
+
command += sys.argv[1:]
|
|
44
|
+
|
|
45
|
+
# as MS Windows is not able to run Python scripts directly by name,
|
|
46
|
+
# we have to call the interpreter and pass the script as parameter
|
|
47
|
+
return subprocess.call(command)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def cppcheck():
|
|
51
|
+
raise SystemExit(_run("cppcheck"))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def cppcheck_htmlreport():
|
|
55
|
+
raise SystemExit(_run_python("cppcheck-htmlreport"))
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
import cppcheckdata
|
|
3
|
+
import sys
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
__checkers__ = []
|
|
7
|
+
|
|
8
|
+
def checker(f):
|
|
9
|
+
__checkers__.append(f)
|
|
10
|
+
return f
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
__errorid__ = ''
|
|
14
|
+
__addon_name__ = ''
|
|
15
|
+
def reportError(location, severity, message, errorId=None):
|
|
16
|
+
cppcheckdata.reportError(location, severity, message, __addon_name__, errorId or __errorid__)
|
|
17
|
+
|
|
18
|
+
def runcheckers():
|
|
19
|
+
# If there are no checkers then don't run
|
|
20
|
+
if len(__checkers__) == 0:
|
|
21
|
+
return
|
|
22
|
+
global __addon_name__
|
|
23
|
+
global __errorid__
|
|
24
|
+
addon = sys.argv[0]
|
|
25
|
+
parser = cppcheckdata.ArgumentParser()
|
|
26
|
+
args = parser.parse_args()
|
|
27
|
+
|
|
28
|
+
__addon_name__ = os.path.splitext(os.path.basename(addon))[0]
|
|
29
|
+
|
|
30
|
+
for dumpfile in args.dumpfile:
|
|
31
|
+
if not args.quiet:
|
|
32
|
+
print('Checking %s...' % dumpfile)
|
|
33
|
+
|
|
34
|
+
data = cppcheckdata.CppcheckData(dumpfile)
|
|
35
|
+
|
|
36
|
+
for cfg in data.iterconfigurations():
|
|
37
|
+
if not args.quiet:
|
|
38
|
+
print('Checking %s, config %s...' % (dumpfile, cfg.name))
|
|
39
|
+
for c in __checkers__:
|
|
40
|
+
__errorid__ = c.__name__
|
|
41
|
+
c(cfg, data)
|