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.
Files changed (156) hide show
  1. {diff_cover-9.4.1 → diff_cover-9.5.0}/PKG-INFO +2 -2
  2. {diff_cover-9.4.1 → diff_cover-9.5.0}/README.rst +1 -1
  3. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_quality_tool.py +2 -0
  4. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/violations_reporter.py +64 -0
  5. {diff_cover-9.4.1 → diff_cover-9.5.0}/pyproject.toml +1 -1
  6. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_violations_reporter.py +21 -0
  7. {diff_cover-9.4.1 → diff_cover-9.5.0}/LICENSE +0 -0
  8. {diff_cover-9.4.1 → diff_cover-9.5.0}/NOTICE +0 -0
  9. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/__init__.py +0 -0
  10. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/command_runner.py +0 -0
  11. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/config_parser.py +0 -0
  12. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_cover_tool.py +0 -0
  13. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/diff_reporter.py +0 -0
  14. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/git_diff.py +0 -0
  15. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/git_path.py +0 -0
  16. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/hook.py +0 -0
  17. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/hookspecs.py +0 -0
  18. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/report_generator.py +0 -0
  19. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/snippets.py +0 -0
  20. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/console_coverage_report.txt +0 -0
  21. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/console_quality_report.txt +0 -0
  22. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/external_style.css +0 -0
  23. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/html_coverage_report.html +0 -0
  24. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/html_quality_report.html +0 -0
  25. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/markdown_coverage_report.md +0 -0
  26. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/markdown_quality_report.md +0 -0
  27. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.html +0 -0
  28. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.md +0 -0
  29. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_content.txt +0 -0
  30. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/templates/snippet_style.html +0 -0
  31. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/util.py +0 -0
  32. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/__init__.py +0 -0
  33. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/base.py +0 -0
  34. {diff_cover-9.4.1 → diff_cover-9.5.0}/diff_cover/violationsreporters/java_violations_reporter.py +0 -0
  35. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/__init__.py +0 -0
  36. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_console_report.txt +0 -0
  37. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_html_report.html +0 -0
  38. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_json_report.json +0 -0
  39. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/add_markdown_report.md +0 -0
  40. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/changed_console_report.txt +0 -0
  41. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/changed_html_report.html +0 -0
  42. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage.xml +0 -0
  43. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage1.xml +0 -0
  44. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage2.xml +0 -0
  45. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/coverage_missing_lines.xml +0 -0
  46. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/cpp_functions_console_report.txt +0 -0
  47. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/cpp_functions_coverage.lcov +0 -0
  48. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/delete_console_report.txt +0 -0
  49. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/delete_html_report.html +0 -0
  50. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/dotnet_coverage.xml +0 -0
  51. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/dotnet_coverage_console_report.txt +0 -0
  52. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/empty.txt +0 -0
  53. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/empty_pycodestyle_violations.txt +0 -0
  54. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/expand_console_report.txt +0 -0
  55. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/external_css_html_report.html +0 -0
  56. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/external_style.css +0 -0
  57. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_add.txt +0 -0
  58. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_changed.txt +0 -0
  59. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_code_dupe.txt +0 -0
  60. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_cpp.txt +0 -0
  61. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_cpp_functions.txt +0 -0
  62. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_delete.txt +0 -0
  63. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_dotnet.txt +0 -0
  64. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_external_css.txt +0 -0
  65. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_lua.txt +0 -0
  66. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_moved.txt +0 -0
  67. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_mult.txt +0 -0
  68. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_python.txt +0 -0
  69. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_subdir.txt +0 -0
  70. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_typescript.txt +0 -0
  71. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_typescript_branches.txt +0 -0
  72. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_unicode.txt +0 -0
  73. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_violations.txt +0 -0
  74. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/git_diff_violations_two_files.txt +0 -0
  75. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/hello.py +0 -0
  76. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/hi.py +0 -0
  77. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report.html +0 -0
  78. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_empty.html +0 -0
  79. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_one_snippet.html +0 -0
  80. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/html_report_two_snippets.html +0 -0
  81. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/lcov.info +0 -0
  82. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/lua_console_report.txt +0 -0
  83. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/luacoverage.xml +0 -0
  84. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/markdown_report_one_snippet.md +0 -0
  85. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/markdown_report_two_snippets.md +0 -0
  86. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_console_report.txt +0 -0
  87. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_coverage.xml +0 -0
  88. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/moved_html_report.html +0 -0
  89. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/mult_inputs_console_report.txt +0 -0
  90. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/mult_inputs_html_report.html +0 -0
  91. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_report.txt +0 -0
  92. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.html +0 -0
  93. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.json +0 -0
  94. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.md +0 -0
  95. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report.txt +0 -0
  96. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pycodestyle_violations_report_external_css.html +0 -0
  97. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_two_files.txt +0 -0
  98. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_violations_report.html +0 -0
  99. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pyflakes_violations_report.txt +0 -0
  100. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_dupe.txt +0 -0
  101. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_dupe_violations_report.txt +0 -0
  102. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_report.txt +0 -0
  103. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_console_report.txt +0 -0
  104. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_report.html +0 -0
  105. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylint_violations_report.txt +0 -0
  106. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/pylintrc +0 -0
  107. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_cpp_console_report.txt +0 -0
  108. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_cpp_coverage.lcov +0 -0
  109. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_python_console_report.txt +0 -0
  110. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_python_coverage.lcov +0 -0
  111. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_typescript_console_report.txt +0 -0
  112. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/real_typescript_coverage.lcov +0 -0
  113. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/show_uncovered_lines_console.txt +0 -0
  114. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet.css +0 -0
  115. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_8859.py +0 -0
  116. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_arabic_output.html +0 -0
  117. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_default.html +0 -0
  118. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_invalid_violations.html +0 -0
  119. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list.html +0 -0
  120. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list.md +0 -0
  121. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list2.md +0 -0
  122. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_list3.md +0 -0
  123. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_no_filename_ext.html +0 -0
  124. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src.py +0 -0
  125. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src2.cpp +0 -0
  126. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_src3.cpp +0 -0
  127. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode.html +0 -0
  128. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode.py +0 -0
  129. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/snippet_unicode_html_output.html +0 -0
  130. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/subdir_coverage_console_report.txt +0 -0
  131. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/subdir_coverage_html_report.html +0 -0
  132. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/test_src.txt +0 -0
  133. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/typescript_branches_console_report.txt +0 -0
  134. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/typescript_branches_coverage.lcov +0 -0
  135. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_console_report.txt +0 -0
  136. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_coverage.xml +0 -0
  137. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_html_report.html +0 -0
  138. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/unicode_test_src.txt +0 -0
  139. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/fixtures/violations_test_file.py +0 -0
  140. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/helpers.py +0 -0
  141. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/snippet_list_unicode.html +0 -0
  142. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_clover_violations_reporter/test.xml +0 -0
  143. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_clover_violations_reporter.py +0 -0
  144. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_config_parser.py +0 -0
  145. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_cover_main.py +0 -0
  146. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_cover_tool.py +0 -0
  147. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_quality_main.py +0 -0
  148. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_diff_reporter.py +0 -0
  149. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_diff.py +0 -0
  150. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_diff_file.py +0 -0
  151. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_git_path.py +0 -0
  152. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_integration.py +0 -0
  153. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_java_violations_reporter.py +0 -0
  154. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_report_generator.py +0 -0
  155. {diff_cover-9.4.1 → diff_cover-9.5.0}/tests/test_snippets.py +0 -0
  156. {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.4.1
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "diff_cover"
3
- version = "9.4.1"
3
+ version = "9.5.0"
4
4
  description = "Run coverage and linting reports on diffs"
5
5
  authors = ["See Contributors"]
6
6
  homepage = "https://github.com/Bachmann1234/diff-cover"
@@ -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