cppcheck-py 2.21.0__py2.py3-none-win_arm64.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.
Files changed (86) hide show
  1. cppcheck/__init__.py +62 -0
  2. cppcheck/cppcheck-2.21.0.tar.gz +0 -0
  3. cppcheck/data/addons/__init__.py +0 -0
  4. cppcheck/data/addons/cppcheck.py +41 -0
  5. cppcheck/data/addons/cppcheckdata.py +1727 -0
  6. cppcheck/data/addons/findcasts.py +32 -0
  7. cppcheck/data/addons/misc.py +163 -0
  8. cppcheck/data/addons/misra.py +5170 -0
  9. cppcheck/data/addons/misra_9.py +559 -0
  10. cppcheck/data/addons/naming.py +92 -0
  11. cppcheck/data/addons/namingng.py +420 -0
  12. cppcheck/data/addons/runaddon.py +16 -0
  13. cppcheck/data/addons/threadsafety.py +352 -0
  14. cppcheck/data/addons/y2038.py +602 -0
  15. cppcheck/data/cfg/avr.cfg +402 -0
  16. cppcheck/data/cfg/bento4.cfg +142 -0
  17. cppcheck/data/cfg/boost.cfg +1284 -0
  18. cppcheck/data/cfg/bsd.cfg +567 -0
  19. cppcheck/data/cfg/cairo.cfg +90 -0
  20. cppcheck/data/cfg/cppcheck-lib.cfg +72 -0
  21. cppcheck/data/cfg/cppunit.cfg +48 -0
  22. cppcheck/data/cfg/dpdk.cfg +11 -0
  23. cppcheck/data/cfg/embedded_sql.cfg +4 -0
  24. cppcheck/data/cfg/emscripten.cfg +108 -0
  25. cppcheck/data/cfg/ginac.cfg +12848 -0
  26. cppcheck/data/cfg/gnu.cfg +1738 -0
  27. cppcheck/data/cfg/googletest.cfg +62 -0
  28. cppcheck/data/cfg/gtk.cfg +23207 -0
  29. cppcheck/data/cfg/icu.cfg +221 -0
  30. cppcheck/data/cfg/kde.cfg +92 -0
  31. cppcheck/data/cfg/libcerror.cfg +203 -0
  32. cppcheck/data/cfg/libcurl.cfg +487 -0
  33. cppcheck/data/cfg/libsigc++.cfg +36 -0
  34. cppcheck/data/cfg/lua.cfg +316 -0
  35. cppcheck/data/cfg/mfc.cfg +271 -0
  36. cppcheck/data/cfg/microsoft_atl.cfg +40 -0
  37. cppcheck/data/cfg/microsoft_sal.cfg +490 -0
  38. cppcheck/data/cfg/microsoft_unittest.cfg +20 -0
  39. cppcheck/data/cfg/motif.cfg +318 -0
  40. cppcheck/data/cfg/nspr.cfg +38 -0
  41. cppcheck/data/cfg/ntl.cfg +6907 -0
  42. cppcheck/data/cfg/opencv2.cfg +132 -0
  43. cppcheck/data/cfg/opengl.cfg +581 -0
  44. cppcheck/data/cfg/openmp.cfg +157 -0
  45. cppcheck/data/cfg/openssl.cfg +174 -0
  46. cppcheck/data/cfg/pcre.cfg +165 -0
  47. cppcheck/data/cfg/posix.cfg +6445 -0
  48. cppcheck/data/cfg/protobuf.cfg +10 -0
  49. cppcheck/data/cfg/python.cfg +674 -0
  50. cppcheck/data/cfg/qt.cfg +5605 -0
  51. cppcheck/data/cfg/ruby.cfg +142 -0
  52. cppcheck/data/cfg/sdl.cfg +354 -0
  53. cppcheck/data/cfg/selinux.cfg +3621 -0
  54. cppcheck/data/cfg/sfml.cfg +301 -0
  55. cppcheck/data/cfg/sqlite3.cfg +1571 -0
  56. cppcheck/data/cfg/std.cfg +9232 -0
  57. cppcheck/data/cfg/tinyxml2.cfg +37 -0
  58. cppcheck/data/cfg/vcl.cfg +4 -0
  59. cppcheck/data/cfg/windows.cfg +17237 -0
  60. cppcheck/data/cfg/wxsqlite3.cfg +1955 -0
  61. cppcheck/data/cfg/wxsvg.cfg +16905 -0
  62. cppcheck/data/cfg/wxwidgets.cfg +17313 -0
  63. cppcheck/data/cfg/zephyr.cfg +113 -0
  64. cppcheck/data/cfg/zlib.cfg +1450 -0
  65. cppcheck/data/cppcheck-htmlreport +1157 -0
  66. cppcheck/data/cppcheck.exe +0 -0
  67. cppcheck/data/platforms/aix_ppc64.xml +18 -0
  68. cppcheck/data/platforms/arm32-wchar_t2.xml +18 -0
  69. cppcheck/data/platforms/arm32-wchar_t4.xml +18 -0
  70. cppcheck/data/platforms/arm64-wchar_t2.xml +18 -0
  71. cppcheck/data/platforms/arm64-wchar_t4.xml +18 -0
  72. cppcheck/data/platforms/avr8.xml +18 -0
  73. cppcheck/data/platforms/cray_sv1.xml +18 -0
  74. cppcheck/data/platforms/elbrus-e1cp.xml +18 -0
  75. cppcheck/data/platforms/mips32.xml +18 -0
  76. cppcheck/data/platforms/msp430_eabi_large_datamodel.xml +18 -0
  77. cppcheck/data/platforms/pic16.xml +18 -0
  78. cppcheck/data/platforms/pic8-enhanced.xml +18 -0
  79. cppcheck/data/platforms/pic8.xml +18 -0
  80. cppcheck/data/platforms/riscv32.xml +18 -0
  81. cppcheck/data/platforms/riscv64.xml +18 -0
  82. cppcheck_py-2.21.0.dist-info/METADATA +75 -0
  83. cppcheck_py-2.21.0.dist-info/RECORD +86 -0
  84. cppcheck_py-2.21.0.dist-info/WHEEL +6 -0
  85. cppcheck_py-2.21.0.dist-info/entry_points.txt +4 -0
  86. cppcheck_py-2.21.0.dist-info/licenses/LICENSE.md +191 -0
cppcheck/__init__.py ADDED
@@ -0,0 +1,62 @@
1
+ import subprocess
2
+ import sys
3
+ from pathlib import Path
4
+ import functools
5
+ import os
6
+
7
+ if sys.version_info.minor >= 9:
8
+ # Only available on 3.9 or later, and required on 3.12
9
+ from importlib.resources import files
10
+ else:
11
+ import pkg_resources
12
+
13
+ def get_executable(name:str) -> Path:
14
+ return _get_executable(name)
15
+
16
+
17
+ @functools.lru_cache(maxsize=None)
18
+ def _get_executable(name:str) -> Path:
19
+ if sys.version_info.minor >= 9:
20
+ # Only available in 3.9 or later, and required in 3.12
21
+ possibles = [
22
+ Path(files("cppcheck") / f"data/{name}{s}")
23
+ for s in ("", ".exe", ".bin", ".dmg")
24
+ ]
25
+ else:
26
+ possibles = [
27
+ Path(pkg_resources.resource_filename("cppcheck", f"data/{name}{s}"))
28
+ for s in ("", ".exe", ".bin", ".dmg")
29
+ ]
30
+ for exe in possibles:
31
+ if exe.exists():
32
+ if os.environ.get("CPPCHECK_WHEEL_VERBOSE", None):
33
+ print(f'Found binary: {exe} ')
34
+ return exe
35
+
36
+ possibles_str = "\n\t".join(map(str, possibles))
37
+ raise FileNotFoundError(f"No executable found for {name} at\n\t{possibles_str}")
38
+
39
+ def _run(name, *args):
40
+ command = [_get_executable(name)]
41
+ if args:
42
+ command += list(args)
43
+ else:
44
+ command += sys.argv[1:]
45
+ return subprocess.call(command)
46
+
47
+ def _run_python(name, *args):
48
+ command = [sys.executable, _get_executable(name)]
49
+ if args:
50
+ command += list(args)
51
+ else:
52
+ command += sys.argv[1:]
53
+
54
+ # as MS Windows is not able to run Python scripts directly by name,
55
+ # we have to call the interpreter and pass the script as parameter
56
+ return subprocess.call(command)
57
+
58
+ def cppcheck():
59
+ raise SystemExit(_run("cppcheck"))
60
+
61
+ def cppcheck_htmlreport():
62
+ 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)