diff-cover 9.4.1__tar.gz → 9.5.0__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.
- {diff_cover-9.4.1 → diff_cover-9.5.0}/PKG-INFO +2 -2
- {diff_cover-9.4.1 → diff_cover-9.5.0}/README.rst +1 -1
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_quality_tool.py +2 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/violations_reporter.py +64 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/pyproject.toml +1 -1
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_violations_reporter.py +21 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/LICENSE +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/NOTICE +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/__init__.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/command_runner.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/config_parser.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_cover_tool.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_reporter.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/git_diff.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/git_path.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/hook.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/hookspecs.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/report_generator.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/snippets.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/console_coverage_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/console_quality_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/external_style.css +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/html_coverage_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/html_quality_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/markdown_coverage_report.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/markdown_quality_report.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_style.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/util.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/__init__.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/base.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/java_violations_reporter.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/__init__.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_json_report.json +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_markdown_report.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/changed_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/changed_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage1.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage2.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage_missing_lines.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/cpp_functions_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/cpp_functions_coverage.lcov +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/delete_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/delete_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/dotnet_coverage.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/dotnet_coverage_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/empty.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/empty_pycodestyle_violations.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/expand_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/external_css_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/external_style.css +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_add.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_changed.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_code_dupe.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_cpp.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_cpp_functions.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_delete.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_dotnet.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_external_css.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_lua.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_moved.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_mult.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_python.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_subdir.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_typescript.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_typescript_branches.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_unicode.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_violations.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_violations_two_files.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/hello.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/hi.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_empty.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_one_snippet.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_two_snippets.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/lcov.info +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/lua_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/luacoverage.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/markdown_report_one_snippet.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/markdown_report_two_snippets.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_coverage.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/mult_inputs_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/mult_inputs_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.json +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report_external_css.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_two_files.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_violations_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_violations_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_dupe.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_dupe_violations_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylintrc +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_cpp_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_cpp_coverage.lcov +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_python_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_python_coverage.lcov +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_typescript_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_typescript_coverage.lcov +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/show_uncovered_lines_console.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet.css +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_8859.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_arabic_output.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_default.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_invalid_violations.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list2.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list3.md +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_no_filename_ext.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src2.cpp +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src3.cpp +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode_html_output.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/subdir_coverage_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/subdir_coverage_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/test_src.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/typescript_branches_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/typescript_branches_coverage.lcov +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_console_report.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_coverage.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_html_report.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_test_src.txt +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/violations_test_file.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/helpers.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/snippet_list_unicode.html +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_clover_violations_reporter/test.xml +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_clover_violations_reporter.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_config_parser.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_cover_main.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_cover_tool.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_quality_main.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_reporter.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_diff.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_diff_file.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_path.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_integration.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_java_violations_reporter.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_report_generator.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_snippets.py +0 -0
- {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: diff_cover
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.5.0
|
|
4
4
|
Summary: Run coverage and linting reports on diffs
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: See Contributors
|
|
@@ -161,7 +161,7 @@ You can use diff-cover to see quality reports on the diff as well by running
|
|
|
161
161
|
diff-quality --violations=<tool>
|
|
162
162
|
|
|
163
163
|
Where ``tool`` is the quality checker to use. Currently ``pycodestyle``, ``pyflakes``,
|
|
164
|
-
``flake8``, ``pylint``, ``checkstyle``, ``checkstylexml``, ``ruff check`` are supported, but more
|
|
164
|
+
``flake8``, ``pylint``, ``checkstyle``, ``checkstylexml``, ``ruff check``, ``clang`` are supported, but more
|
|
165
165
|
checkers can (and should!) be supported. See the section "Adding `diff-quality``
|
|
166
166
|
Support for a New Quality Checker".
|
|
167
167
|
|
|
@@ -129,7 +129,7 @@ You can use diff-cover to see quality reports on the diff as well by running
|
|
|
129
129
|
diff-quality --violations=<tool>
|
|
130
130
|
|
|
131
131
|
Where ``tool`` is the quality checker to use. Currently ``pycodestyle``, ``pyflakes``,
|
|
132
|
-
``flake8``, ``pylint``, ``checkstyle``, ``checkstylexml``, ``ruff check`` are supported, but more
|
|
132
|
+
``flake8``, ``pylint``, ``checkstyle``, ``checkstylexml``, ``ruff check``, ``clang`` are supported, but more
|
|
133
133
|
checkers can (and should!) be supported. See the section "Adding `diff-quality``
|
|
134
134
|
Support for a New Quality Checker".
|
|
135
135
|
|
|
@@ -50,6 +50,7 @@ from diff_cover.violationsreporters.java_violations_reporter import (
|
|
|
50
50
|
checkstyle_driver,
|
|
51
51
|
)
|
|
52
52
|
from diff_cover.violationsreporters.violations_reporter import (
|
|
53
|
+
ClangFormatDriver,
|
|
53
54
|
CppcheckDriver,
|
|
54
55
|
EslintDriver,
|
|
55
56
|
PylintDriver,
|
|
@@ -63,6 +64,7 @@ from diff_cover.violationsreporters.violations_reporter import (
|
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
QUALITY_DRIVERS = {
|
|
67
|
+
"clang": ClangFormatDriver(),
|
|
66
68
|
"cppcheck": CppcheckDriver(),
|
|
67
69
|
"pycodestyle": pycodestyle_driver,
|
|
68
70
|
"pyflakes": pyflakes_driver,
|
|
@@ -831,3 +831,67 @@ class CppcheckDriver(QualityDriver):
|
|
|
831
831
|
Returns: boolean True if installed
|
|
832
832
|
"""
|
|
833
833
|
return run_command_for_code(self.command_to_check_install) == 0
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
class ClangFormatDriver(QualityDriver):
|
|
837
|
+
"""
|
|
838
|
+
Driver for clang-format
|
|
839
|
+
"""
|
|
840
|
+
|
|
841
|
+
def __init__(self):
|
|
842
|
+
"""
|
|
843
|
+
args:
|
|
844
|
+
expression: regex used to parse report
|
|
845
|
+
See super for other args
|
|
846
|
+
"""
|
|
847
|
+
super().__init__(
|
|
848
|
+
"clang",
|
|
849
|
+
["c", "cpp", "h", "hpp"],
|
|
850
|
+
["clang-format", "--dry-run"], # Use dry-run option to not modify files
|
|
851
|
+
output_stderr=True,
|
|
852
|
+
)
|
|
853
|
+
|
|
854
|
+
# Errors look like:
|
|
855
|
+
# src/foo.c:8:1: warning: code should be clang-formatted [-Wclang-format-violations]
|
|
856
|
+
# int foo;
|
|
857
|
+
# ^
|
|
858
|
+
# Match for everything, including ":" in the file name (first capturing
|
|
859
|
+
# group), in case there are pathological path names with ":"
|
|
860
|
+
self.clang_expression = re.compile(
|
|
861
|
+
r"^(.*?):(\d+):\d+: ([^[]* \[[^]]*\])\n(.+)\n(.+)$",
|
|
862
|
+
re.MULTILINE,
|
|
863
|
+
)
|
|
864
|
+
self.command_to_check_install = ["clang-format", "--version"]
|
|
865
|
+
|
|
866
|
+
def parse_reports(self, reports):
|
|
867
|
+
"""
|
|
868
|
+
Args:
|
|
869
|
+
reports: list[str] - output from the report
|
|
870
|
+
Return:
|
|
871
|
+
A dict[Str:Violation]
|
|
872
|
+
Violation is a simple named tuple Defined above
|
|
873
|
+
"""
|
|
874
|
+
violations_dict = defaultdict(list)
|
|
875
|
+
for report in reports:
|
|
876
|
+
|
|
877
|
+
matches = list(re.finditer(self.clang_expression, report))
|
|
878
|
+
for match in matches:
|
|
879
|
+
if match is not None:
|
|
880
|
+
(
|
|
881
|
+
clang_src_path,
|
|
882
|
+
line_number,
|
|
883
|
+
message,
|
|
884
|
+
code_extract,
|
|
885
|
+
cursor_error,
|
|
886
|
+
) = match.groups()
|
|
887
|
+
full_message = f"{message}\n{code_extract}\n{cursor_error}"
|
|
888
|
+
violation = Violation(int(line_number), full_message)
|
|
889
|
+
violations_dict[clang_src_path].append(violation)
|
|
890
|
+
return violations_dict
|
|
891
|
+
|
|
892
|
+
def installed(self):
|
|
893
|
+
"""
|
|
894
|
+
Method checks if the provided tool is installed.
|
|
895
|
+
Returns: boolean True if installed
|
|
896
|
+
"""
|
|
897
|
+
return run_command_for_code(self.command_to_check_install) == 0
|
|
@@ -17,6 +17,7 @@ from diff_cover.command_runner import CommandError, run_command_for_code
|
|
|
17
17
|
from diff_cover.violationsreporters import base
|
|
18
18
|
from diff_cover.violationsreporters.base import QualityReporter
|
|
19
19
|
from diff_cover.violationsreporters.violations_reporter import (
|
|
20
|
+
ClangFormatDriver,
|
|
20
21
|
CppcheckDriver,
|
|
21
22
|
EslintDriver,
|
|
22
23
|
LcovCoverageReporter,
|
|
@@ -2238,3 +2239,23 @@ class TestRuffCheckQualityDriverTest:
|
|
|
2238
2239
|
|
|
2239
2240
|
assert quality.name() == "ruff.check"
|
|
2240
2241
|
assert actual_violations == expected_violations
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
class TestClangFormatcheckQualityDriverTest:
|
|
2245
|
+
"""Tests for clang-format quality driver."""
|
|
2246
|
+
|
|
2247
|
+
def test_parse_report(self):
|
|
2248
|
+
"""Basic report test parse"""
|
|
2249
|
+
expected_violations = {
|
|
2250
|
+
"src/foo.c": [
|
|
2251
|
+
Violation(
|
|
2252
|
+
12,
|
|
2253
|
+
"warning: code should be clang-formatted [-Wclang-format-violations]\n int bar;\n ^",
|
|
2254
|
+
),
|
|
2255
|
+
]
|
|
2256
|
+
}
|
|
2257
|
+
report = "src/foo.c:12:1: warning: code should be clang-formatted [-Wclang-format-violations]\n int bar;\n ^"
|
|
2258
|
+
|
|
2259
|
+
driver = ClangFormatDriver()
|
|
2260
|
+
actual_violations = driver.parse_reports([report])
|
|
2261
|
+
assert actual_violations == expected_violations
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/java_violations_reporter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report_external_css.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|