diff-cover 9.2.2__tar.gz → 9.2.4__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 (139) hide show
  1. diff_cover-9.2.4/NOTICE +5 -0
  2. {diff_cover-9.2.2 → diff_cover-9.2.4}/PKG-INFO +4 -4
  3. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/git_diff.py +2 -1
  4. diff_cover-9.2.4/diff_cover/util.py +56 -0
  5. {diff_cover-9.2.2 → diff_cover-9.2.4}/pyproject.toml +5 -5
  6. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pycodestyle_violations_report_external_css.html +2 -2
  7. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet.css +2 -2
  8. diff_cover-9.2.4/tests/test_util.py +23 -0
  9. diff_cover-9.2.2/diff_cover/util.py +0 -17
  10. diff_cover-9.2.2/tests/test_util.py +0 -13
  11. {diff_cover-9.2.2 → diff_cover-9.2.4}/LICENSE +0 -0
  12. {diff_cover-9.2.2 → diff_cover-9.2.4}/README.rst +0 -0
  13. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/__init__.py +0 -0
  14. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/command_runner.py +0 -0
  15. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/config_parser.py +0 -0
  16. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/diff_cover_tool.py +0 -0
  17. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/diff_quality_tool.py +0 -0
  18. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/diff_reporter.py +0 -0
  19. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/git_path.py +0 -0
  20. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/hook.py +0 -0
  21. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/hookspecs.py +0 -0
  22. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/report_generator.py +0 -0
  23. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/snippets.py +0 -0
  24. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/console_coverage_report.txt +0 -0
  25. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/console_quality_report.txt +0 -0
  26. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/external_style.css +0 -0
  27. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/html_coverage_report.html +0 -0
  28. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/html_quality_report.html +0 -0
  29. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/markdown_coverage_report.md +0 -0
  30. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/markdown_quality_report.md +0 -0
  31. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/snippet_content.html +0 -0
  32. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/snippet_content.md +0 -0
  33. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/snippet_content.txt +0 -0
  34. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/templates/snippet_style.html +0 -0
  35. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/violationsreporters/__init__.py +0 -0
  36. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/violationsreporters/base.py +0 -0
  37. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/violationsreporters/java_violations_reporter.py +0 -0
  38. {diff_cover-9.2.2 → diff_cover-9.2.4}/diff_cover/violationsreporters/violations_reporter.py +0 -0
  39. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/__init__.py +0 -0
  40. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/add_console_report.txt +0 -0
  41. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/add_html_report.html +0 -0
  42. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/changed_console_report.txt +0 -0
  43. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/changed_html_report.html +0 -0
  44. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/coverage.xml +0 -0
  45. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/coverage1.xml +0 -0
  46. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/coverage2.xml +0 -0
  47. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/coverage_missing_lines.xml +0 -0
  48. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/delete_console_report.txt +0 -0
  49. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/delete_html_report.html +0 -0
  50. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/dotnet_coverage.xml +0 -0
  51. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/dotnet_coverage_console_report.txt +0 -0
  52. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/empty.txt +0 -0
  53. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/empty_pycodestyle_violations.txt +0 -0
  54. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/expand_console_report.txt +0 -0
  55. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/external_css_html_report.html +0 -0
  56. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/external_style.css +0 -0
  57. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_add.txt +0 -0
  58. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_changed.txt +0 -0
  59. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_code_dupe.txt +0 -0
  60. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_delete.txt +0 -0
  61. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_dotnet.txt +0 -0
  62. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_external_css.txt +0 -0
  63. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_lua.txt +0 -0
  64. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_moved.txt +0 -0
  65. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_mult.txt +0 -0
  66. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_subdir.txt +0 -0
  67. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_unicode.txt +0 -0
  68. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_violations.txt +0 -0
  69. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/git_diff_violations_two_files.txt +0 -0
  70. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/hello.py +0 -0
  71. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/hi.py +0 -0
  72. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/html_report.html +0 -0
  73. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/html_report_empty.html +0 -0
  74. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/html_report_one_snippet.html +0 -0
  75. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/html_report_two_snippets.html +0 -0
  76. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/lcov.info +0 -0
  77. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/lua_console_report.txt +0 -0
  78. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/luacoverage.xml +0 -0
  79. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/markdown_report_one_snippet.md +0 -0
  80. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/markdown_report_two_snippets.md +0 -0
  81. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/moved_console_report.txt +0 -0
  82. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/moved_coverage.xml +0 -0
  83. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/moved_html_report.html +0 -0
  84. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/mult_inputs_console_report.txt +0 -0
  85. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/mult_inputs_html_report.html +0 -0
  86. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pycodestyle_report.txt +0 -0
  87. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pycodestyle_violations_report.html +0 -0
  88. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pycodestyle_violations_report.txt +0 -0
  89. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pyflakes_two_files.txt +0 -0
  90. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pyflakes_violations_report.html +0 -0
  91. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pyflakes_violations_report.txt +0 -0
  92. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_dupe.txt +0 -0
  93. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_dupe_violations_report.txt +0 -0
  94. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_report.txt +0 -0
  95. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_violations_console_report.txt +0 -0
  96. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_violations_report.html +0 -0
  97. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylint_violations_report.txt +0 -0
  98. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/pylintrc +0 -0
  99. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/show_uncovered_lines_console.txt +0 -0
  100. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_8859.py +0 -0
  101. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_arabic_output.html +0 -0
  102. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_default.html +0 -0
  103. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_invalid_violations.html +0 -0
  104. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_list.html +0 -0
  105. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_list.md +0 -0
  106. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_list2.md +0 -0
  107. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_list3.md +0 -0
  108. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_no_filename_ext.html +0 -0
  109. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_src.py +0 -0
  110. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_src2.cpp +0 -0
  111. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_src3.cpp +0 -0
  112. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_unicode.html +0 -0
  113. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_unicode.py +0 -0
  114. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/snippet_unicode_html_output.html +0 -0
  115. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/subdir_coverage_console_report.txt +0 -0
  116. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/subdir_coverage_html_report.html +0 -0
  117. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/test_src.txt +0 -0
  118. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/unicode_console_report.txt +0 -0
  119. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/unicode_coverage.xml +0 -0
  120. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/unicode_html_report.html +0 -0
  121. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/unicode_test_src.txt +0 -0
  122. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/fixtures/violations_test_file.py +0 -0
  123. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/helpers.py +0 -0
  124. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/snippet_list_unicode.html +0 -0
  125. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_clover_violations_reporter/test.xml +0 -0
  126. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_clover_violations_reporter.py +0 -0
  127. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_config_parser.py +0 -0
  128. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_diff_cover_main.py +0 -0
  129. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_diff_cover_tool.py +0 -0
  130. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_diff_quality_main.py +0 -0
  131. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_diff_reporter.py +0 -0
  132. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_git_diff.py +0 -0
  133. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_git_diff_file.py +0 -0
  134. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_git_path.py +0 -0
  135. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_integration.py +0 -0
  136. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_java_violations_reporter.py +0 -0
  137. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_report_generator.py +0 -0
  138. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_snippets.py +0 -0
  139. {diff_cover-9.2.2 → diff_cover-9.2.4}/tests/test_violations_reporter.py +0 -0
@@ -0,0 +1,5 @@
1
+ diff-cover
2
+
3
+ Copyright 2013-2014, edX
4
+
5
+ Copyright 2015, Matt Bachmann
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: diff_cover
3
- Version: 9.2.2
3
+ Version: 9.2.4
4
4
  Summary: Run coverage and linting reports on diffs
5
- Home-page: https://github.com/Bachmann1234/diff-cover
6
5
  License: Apache-2.0
7
6
  Author: See Contributors
8
7
  Requires-Python: >=3.9.17,<4.0.0
@@ -23,11 +22,12 @@ Classifier: Topic :: Software Development :: Quality Assurance
23
22
  Classifier: Topic :: Software Development :: Testing
24
23
  Provides-Extra: toml
25
24
  Requires-Dist: Jinja2 (>=2.7.1)
26
- Requires-Dist: Pygments (>=2.9.0,<3.0.0)
25
+ Requires-Dist: Pygments (>=2.19.1,<3.0.0)
27
26
  Requires-Dist: chardet (>=3.0.0)
28
27
  Requires-Dist: pluggy (>=0.13.1,<2)
29
28
  Requires-Dist: setuptools (>=17.0.0) ; python_version < "3.8"
30
29
  Requires-Dist: tomli (>=1.2.1) ; extra == "toml"
30
+ Project-URL: Homepage, https://github.com/Bachmann1234/diff-cover
31
31
  Project-URL: Repository, https://github.com/Bachmann1234/diff-cover
32
32
  Description-Content-Type: text/x-rst
33
33
 
@@ -5,6 +5,7 @@ Wrapper for `git diff` command.
5
5
  from textwrap import dedent
6
6
 
7
7
  from diff_cover.command_runner import CommandError, execute
8
+ from diff_cover.util import to_unescaped_filename
8
9
 
9
10
 
10
11
  class GitDiffError(Exception):
@@ -109,7 +110,7 @@ class GitDiffTool:
109
110
  output = execute(["git", "ls-files", "--exclude-standard", "--others"])[0]
110
111
  if not output:
111
112
  return []
112
- return [line for line in output.splitlines() if line]
113
+ return [to_unescaped_filename(line) for line in output.splitlines() if line]
113
114
 
114
115
 
115
116
  class GitDiffFileTool(GitDiffTool):
@@ -0,0 +1,56 @@
1
+ import os.path
2
+ import posixpath
3
+
4
+
5
+ def to_unix_path(path):
6
+ """
7
+ Tries to ensure tha the path is a normalized unix path.
8
+ This seems to be the solution cobertura used....
9
+ https://github.com/cobertura/cobertura/blob/642a46eb17e14f51272c6962e64e56e0960918af/cobertura/src/main/java/net/sourceforge/cobertura/instrument/ClassPattern.java#L84
10
+
11
+ I know of at least one case where this will fail (\\) is allowed in unix paths.
12
+ But I am taking the bet that this is not common. We deal with source code.
13
+
14
+ :param path: string of the path to convert
15
+ :return: the unix version of that path
16
+ """
17
+ return posixpath.normpath(os.path.normcase(path).replace("\\", "/"))
18
+
19
+
20
+ def to_unescaped_filename(filename: str) -> str:
21
+ """Try to unescape the given filename.
22
+
23
+ Some filenames given by git might be escaped with C-style escape sequences
24
+ and surrounded by double quotes.
25
+ """
26
+ if not (filename.startswith('"') and filename.endswith('"')):
27
+ return filename
28
+
29
+ # Remove surrounding quotes
30
+ unquoted = filename[1:-1]
31
+
32
+ # Handle C-style escape sequences
33
+ result = []
34
+ i = 0
35
+ while i < len(unquoted):
36
+ if unquoted[i] == "\\" and i + 1 < len(unquoted):
37
+ # Handle common C escape sequences
38
+ next_char = unquoted[i + 1]
39
+ result.append(
40
+ {
41
+ "\\": "\\",
42
+ '"': '"',
43
+ "a": "a",
44
+ "n": "\n",
45
+ "t": "\t",
46
+ "r": "\r",
47
+ "b": "\b",
48
+ "f": "\f",
49
+ }.get(next_char, next_char)
50
+ )
51
+ i += 2
52
+ else:
53
+ result.append(unquoted[i])
54
+ i += 1
55
+
56
+ return "".join(result)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "diff_cover"
3
- version = "9.2.2"
3
+ version = "9.2.4"
4
4
  description = "Run coverage and linting reports on diffs"
5
5
  authors = ["See Contributors"]
6
6
  homepage = "https://github.com/Bachmann1234/diff-cover"
@@ -41,7 +41,7 @@ diff-quality = 'diff_cover.diff_quality_tool:main'
41
41
 
42
42
  [tool.poetry.dependencies]
43
43
  python = "^3.9.17"
44
- Pygments = "^2.9.0"
44
+ Pygments = "^2.19.1"
45
45
  Jinja2 = ">=2.7.1"
46
46
  pluggy = ">=0.13.1,<2"
47
47
  chardet = ">=3.0.0"
@@ -55,11 +55,11 @@ pytest-mock = "^3.14.0"
55
55
  pycodestyle = ">=2.9.1"
56
56
  flake8 = "^5.0.4"
57
57
  pyflakes = "^2.5.0"
58
- pylint = "^3.3.3"
58
+ pylint = "^3.3.4"
59
59
  pylint-pytest = "^1.1.8"
60
60
  pydocstyle = "^6.1.1"
61
- black = "^24.8.0"
62
- isort = "^5.13.2"
61
+ black = "^25.1.0"
62
+ isort = "^6.0.1"
63
63
  doc8 = "1.1.2"
64
64
 
65
65
  [tool.poetry.extras]
@@ -46,12 +46,12 @@
46
46
  <span class="normal"> 9</span>
47
47
  <span class="normal">10</span>
48
48
  <span class="normal">11</span>
49
- <span class="normal">12</span></pre></div></td><td class="code"><div><pre><span></span><a id="violations_test_file.py-1" name="violations_test_file.py-1"></a><span class="k">def</span> <span class="nf">func_1</span><span class="p">(</span><span class="n">apple</span><span class="p">,</span> <span class="n">my_list</span><span class="p">):</span>
49
+ <span class="normal">12</span></pre></div></td><td class="code"><div><pre><span></span><a id="violations_test_file.py-1" name="violations_test_file.py-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">func_1</span><span class="p">(</span><span class="n">apple</span><span class="p">,</span> <span class="n">my_list</span><span class="p">):</span>
50
50
  <a id="violations_test_file.py-2" name="violations_test_file.py-2"></a><span class="hll"> <span class="k">if</span> <span class="n">apple</span><span class="o">&lt;</span><span class="mi">10</span><span class="p">:</span>
51
51
  </span><a id="violations_test_file.py-3" name="violations_test_file.py-3"></a> <span class="c1"># Do something </span>
52
52
  <a id="violations_test_file.py-4" name="violations_test_file.py-4"></a> <span class="n">my_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">apple</span><span class="p">)</span>
53
53
  <a id="violations_test_file.py-5" name="violations_test_file.py-5"></a> <span class="k">return</span> <span class="n">my_list</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
54
- <a id="violations_test_file.py-6" name="violations_test_file.py-6"></a><span class="hll"><span class="k">def</span> <span class="nf">func_2</span><span class="p">(</span><span class="n">spongebob</span><span class="p">,</span> <span class="n">squarepants</span><span class="p">):</span>
54
+ <a id="violations_test_file.py-6" name="violations_test_file.py-6"></a><span class="hll"><span class="k">def</span><span class="w"> </span><span class="nf">func_2</span><span class="p">(</span><span class="n">spongebob</span><span class="p">,</span> <span class="n">squarepants</span><span class="p">):</span>
55
55
  </span><a id="violations_test_file.py-7" name="violations_test_file.py-7"></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;A less messy function&quot;&quot;&quot;</span>
56
56
  <a id="violations_test_file.py-8" name="violations_test_file.py-8"></a> <span class="k">for</span> <span class="n">char</span> <span class="ow">in</span> <span class="n">spongebob</span><span class="p">:</span>
57
57
  <a id="violations_test_file.py-9" name="violations_test_file.py-9"></a> <span class="k">if</span> <span class="n">char</span> <span class="ow">in</span> <span class="n">squarepants</span><span class="p">:</span>
@@ -1,8 +1,8 @@
1
1
  .hll { background-color: #ffcccc }
2
2
  .c { color: #3D7B7B; font-style: italic } /* Comment */
3
3
  .k { color: #008000; font-weight: bold } /* Keyword */
4
- .o { color: #666666 } /* Operator */
5
- .m { color: #666666 } /* Literal.Number */
4
+ .o { color: #666 } /* Operator */
5
+ .m { color: #666 } /* Literal.Number */
6
6
  .s { color: #BA2121 } /* Literal.String */
7
7
  .na { color: #687822 } /* Name.Attribute */
8
8
  .nb { color: #008000 } /* Name.Builtin */
@@ -0,0 +1,23 @@
1
+ import sys
2
+
3
+ from diff_cover import util
4
+
5
+
6
+ def test_to_unix_path():
7
+ """
8
+ Ensure the _to_unix_path static function handles paths properly.
9
+ """
10
+ assert util.to_unix_path("foo/bar") == "foo/bar"
11
+ assert util.to_unix_path("foo\\bar") == "foo/bar"
12
+ if sys.platform.startswith("win"):
13
+ assert util.to_unix_path("FOO\\bar") == "foo/bar"
14
+
15
+
16
+ def test_to_unescaped_filename():
17
+ """Test the to_unescaped_filename function."""
18
+ assert util.to_unescaped_filename('"\\\\\\\\"') == "\\\\"
19
+ assert util.to_unescaped_filename('"\\\\"') == "\\"
20
+ assert util.to_unescaped_filename('"\\"\\\\"') == '"\\'
21
+ assert util.to_unescaped_filename('"\\""') == '"'
22
+ assert util.to_unescaped_filename("some_file.py") == "some_file.py"
23
+ assert util.to_unescaped_filename("#$%") == "#$%"
@@ -1,17 +0,0 @@
1
- import os.path
2
- import posixpath
3
-
4
-
5
- def to_unix_path(path):
6
- """
7
- Tries to ensure tha the path is a normalized unix path.
8
- This seems to be the solution cobertura used....
9
- https://github.com/cobertura/cobertura/blob/642a46eb17e14f51272c6962e64e56e0960918af/cobertura/src/main/java/net/sourceforge/cobertura/instrument/ClassPattern.java#L84
10
-
11
- I know of at least one case where this will fail (\\) is allowed in unix paths.
12
- But I am taking the bet that this is not common. We deal with source code.
13
-
14
- :param path: string of the path to convert
15
- :return: the unix version of that path
16
- """
17
- return posixpath.normpath(os.path.normcase(path).replace("\\", "/"))
@@ -1,13 +0,0 @@
1
- import sys
2
-
3
- from diff_cover import util
4
-
5
-
6
- def test_to_unix_path():
7
- """
8
- Ensure the _to_unix_path static function handles paths properly.
9
- """
10
- assert util.to_unix_path("foo/bar") == "foo/bar"
11
- assert util.to_unix_path("foo\\bar") == "foo/bar"
12
- if sys.platform.startswith("win"):
13
- assert util.to_unix_path("FOO\\bar") == "foo/bar"
File without changes
File without changes
File without changes
File without changes