pytest-cppcheck 0.1.1__tar.gz → 0.1.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-cppcheck
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A pytest plugin that runs cppcheck static analysis on C/C++ source files
5
5
  Author-email: Alex DeJarnatt <adejarnatt@gmail.com>
6
6
  License: MIT License
@@ -29,6 +29,12 @@ Project-URL: Homepage, https://github.com/alexdej/pytest-cppcheck
29
29
  Project-URL: Repository, https://github.com/alexdej/pytest-cppcheck
30
30
  Classifier: Framework :: Pytest
31
31
  Classifier: Programming Language :: Python :: 3
32
+ Classifier: Programming Language :: Python :: 3.8
33
+ Classifier: Programming Language :: Python :: 3.9
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Programming Language :: Python :: 3.13
32
38
  Classifier: License :: OSI Approved :: MIT License
33
39
  Requires-Python: >=3.8
34
40
  Description-Content-Type: text/markdown
@@ -39,6 +45,11 @@ Dynamic: license-file
39
45
 
40
46
  # pytest-cppcheck
41
47
 
48
+ [![CI](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml)
49
+ [![PyPI](https://img.shields.io/pypi/v/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
50
+ [![Python](https://img.shields.io/pypi/pyversions/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
51
+ [![License](https://img.shields.io/pypi/l/pytest-cppcheck)](https://github.com/alexdej/pytest-cppcheck/blob/main/LICENSE)
52
+
42
53
  A pytest plugin that runs [cppcheck](https://cppcheck.sourceforge.io/) static
43
54
  analysis on C/C++ source files. Each file is collected as a test item and
44
55
  reported as a pass or failure in the normal pytest output.
@@ -98,15 +109,9 @@ configuration:
98
109
  [pytest]
99
110
  cppcheck_args =
100
111
  --enable=warning,style,performance,portability
101
- --suppress=missingIncludeSystem
102
- --suppress=normalCheckLevelMaxBranches
112
+ --check-level=exhaustive
103
113
  ```
104
114
 
105
- `missingIncludeSystem` suppresses noise about system headers that aren't
106
- available to cppcheck. `normalCheckLevelMaxBranches` suppresses an
107
- informational message that cppcheck emits on complex files and that would
108
- otherwise be reported as a failure.
109
-
110
115
  ### `cppcheck_extensions`
111
116
 
112
117
  File extensions to collect. Default: `.c .cpp`.
@@ -116,6 +121,17 @@ File extensions to collect. Default: `.c .cpp`.
116
121
  cppcheck_extensions = .c .cpp .h
117
122
  ```
118
123
 
124
+ ## Markers
125
+
126
+ All cppcheck items are marked with `cppcheck`, so you can select or exclude
127
+ them with `-m`:
128
+
129
+ ```
130
+ pytest --cppcheck -m cppcheck # only cppcheck
131
+ pytest --cppcheck -m "unit or cppcheck" # unit tests + cppcheck
132
+ pytest --cppcheck -m "not cppcheck" # everything except cppcheck
133
+ ```
134
+
119
135
  ## Caching
120
136
 
121
137
  Results are cached based on file modification time and `cppcheck_args`. On
@@ -1,5 +1,10 @@
1
1
  # pytest-cppcheck
2
2
 
3
+ [![CI](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
6
+ [![License](https://img.shields.io/pypi/l/pytest-cppcheck)](https://github.com/alexdej/pytest-cppcheck/blob/main/LICENSE)
7
+
3
8
  A pytest plugin that runs [cppcheck](https://cppcheck.sourceforge.io/) static
4
9
  analysis on C/C++ source files. Each file is collected as a test item and
5
10
  reported as a pass or failure in the normal pytest output.
@@ -59,15 +64,9 @@ configuration:
59
64
  [pytest]
60
65
  cppcheck_args =
61
66
  --enable=warning,style,performance,portability
62
- --suppress=missingIncludeSystem
63
- --suppress=normalCheckLevelMaxBranches
67
+ --check-level=exhaustive
64
68
  ```
65
69
 
66
- `missingIncludeSystem` suppresses noise about system headers that aren't
67
- available to cppcheck. `normalCheckLevelMaxBranches` suppresses an
68
- informational message that cppcheck emits on complex files and that would
69
- otherwise be reported as a failure.
70
-
71
70
  ### `cppcheck_extensions`
72
71
 
73
72
  File extensions to collect. Default: `.c .cpp`.
@@ -77,6 +76,17 @@ File extensions to collect. Default: `.c .cpp`.
77
76
  cppcheck_extensions = .c .cpp .h
78
77
  ```
79
78
 
79
+ ## Markers
80
+
81
+ All cppcheck items are marked with `cppcheck`, so you can select or exclude
82
+ them with `-m`:
83
+
84
+ ```
85
+ pytest --cppcheck -m cppcheck # only cppcheck
86
+ pytest --cppcheck -m "unit or cppcheck" # unit tests + cppcheck
87
+ pytest --cppcheck -m "not cppcheck" # everything except cppcheck
88
+ ```
89
+
80
90
  ## Caching
81
91
 
82
92
  Results are cached based on file modification time and `cppcheck_args`. On
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pytest-cppcheck"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "A pytest plugin that runs cppcheck static analysis on C/C++ source files"
9
9
  readme = "README.md"
10
10
  license = {file = "LICENSE"}
@@ -19,6 +19,12 @@ dependencies = [
19
19
  classifiers = [
20
20
  "Framework :: Pytest",
21
21
  "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.8",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
22
28
  "License :: OSI Approved :: MIT License",
23
29
  ]
24
30
 
@@ -30,6 +30,7 @@ def pytest_addoption(parser):
30
30
 
31
31
 
32
32
  def pytest_configure(config):
33
+ config.addinivalue_line("markers", "cppcheck: cppcheck static analysis test")
33
34
  if not config.getoption("cppcheck"):
34
35
  return
35
36
  cache = getattr(config, "cache", None)
@@ -60,7 +61,9 @@ class CppcheckError(Exception):
60
61
 
61
62
  class CppcheckFile(pytest.File):
62
63
  def collect(self):
63
- yield CppcheckItem.from_parent(self, name="CPPCHECK")
64
+ item = CppcheckItem.from_parent(self, name="CPPCHECK")
65
+ item.add_marker(pytest.mark.cppcheck)
66
+ yield item
64
67
 
65
68
 
66
69
  class CppcheckItem(pytest.Item):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-cppcheck
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A pytest plugin that runs cppcheck static analysis on C/C++ source files
5
5
  Author-email: Alex DeJarnatt <adejarnatt@gmail.com>
6
6
  License: MIT License
@@ -29,6 +29,12 @@ Project-URL: Homepage, https://github.com/alexdej/pytest-cppcheck
29
29
  Project-URL: Repository, https://github.com/alexdej/pytest-cppcheck
30
30
  Classifier: Framework :: Pytest
31
31
  Classifier: Programming Language :: Python :: 3
32
+ Classifier: Programming Language :: Python :: 3.8
33
+ Classifier: Programming Language :: Python :: 3.9
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Programming Language :: Python :: 3.13
32
38
  Classifier: License :: OSI Approved :: MIT License
33
39
  Requires-Python: >=3.8
34
40
  Description-Content-Type: text/markdown
@@ -39,6 +45,11 @@ Dynamic: license-file
39
45
 
40
46
  # pytest-cppcheck
41
47
 
48
+ [![CI](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/alexdej/pytest-cppcheck/actions/workflows/ci.yml)
49
+ [![PyPI](https://img.shields.io/pypi/v/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
50
+ [![Python](https://img.shields.io/pypi/pyversions/pytest-cppcheck)](https://pypi.org/project/pytest-cppcheck/)
51
+ [![License](https://img.shields.io/pypi/l/pytest-cppcheck)](https://github.com/alexdej/pytest-cppcheck/blob/main/LICENSE)
52
+
42
53
  A pytest plugin that runs [cppcheck](https://cppcheck.sourceforge.io/) static
43
54
  analysis on C/C++ source files. Each file is collected as a test item and
44
55
  reported as a pass or failure in the normal pytest output.
@@ -98,15 +109,9 @@ configuration:
98
109
  [pytest]
99
110
  cppcheck_args =
100
111
  --enable=warning,style,performance,portability
101
- --suppress=missingIncludeSystem
102
- --suppress=normalCheckLevelMaxBranches
112
+ --check-level=exhaustive
103
113
  ```
104
114
 
105
- `missingIncludeSystem` suppresses noise about system headers that aren't
106
- available to cppcheck. `normalCheckLevelMaxBranches` suppresses an
107
- informational message that cppcheck emits on complex files and that would
108
- otherwise be reported as a failure.
109
-
110
115
  ### `cppcheck_extensions`
111
116
 
112
117
  File extensions to collect. Default: `.c .cpp`.
@@ -116,6 +121,17 @@ File extensions to collect. Default: `.c .cpp`.
116
121
  cppcheck_extensions = .c .cpp .h
117
122
  ```
118
123
 
124
+ ## Markers
125
+
126
+ All cppcheck items are marked with `cppcheck`, so you can select or exclude
127
+ them with `-m`:
128
+
129
+ ```
130
+ pytest --cppcheck -m cppcheck # only cppcheck
131
+ pytest --cppcheck -m "unit or cppcheck" # unit tests + cppcheck
132
+ pytest --cppcheck -m "not cppcheck" # everything except cppcheck
133
+ ```
134
+
119
135
  ## Caching
120
136
 
121
137
  Results are cached based on file modification time and `cppcheck_args`. On
File without changes