pre-commit-html 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.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.
@@ -56,24 +56,25 @@ class PreCommitParser:
56
56
  if "\\" in line and ":" in line and len(code_part) == 0:
57
57
  h3_file = line.replace("\\", "/")
58
58
 
59
- path_code_file = h3_file.split(":")[0]
60
- line_code = h3_file.split(":")[1]
61
- column_code = h3_file.split(":")[2]
62
- message = h3_file.split(":")[3]
63
-
64
- ruff_ref = message.split(" ")[1]
65
-
66
- code_error.append(
67
- "".join(
68
- (
69
- f'<h3>File: <a href="./{path_code_file}:{line_code}:',
70
- f'{column_code}">{path_code_file}:{line_code}:{column_code}</a></h3>',
59
+ if len(h3_file.split(":")) == 4:
60
+ path_code_file = h3_file.split(":")[0]
61
+ line_code = h3_file.split(":")[1]
62
+ column_code = h3_file.split(":")[2]
63
+ message = h3_file.split(":")[3]
64
+
65
+ ruff_ref = message.split(" ")[1]
66
+
67
+ code_error.append(
68
+ "".join(
69
+ (
70
+ f'<h3>File: <a href="./{path_code_file}:{line_code}:',
71
+ f'{column_code}">{path_code_file}:{line_code}:{column_code}</a></h3>',
72
+ )
71
73
  )
72
74
  )
73
- )
74
- code_error.append(
75
- f'<p>Error: <a href="https://docs.astral.sh/ruff/rules/#{ruff_ref}">{ruff_ref}</a>{message}</p>'
76
- )
75
+ code_error.append(
76
+ f'<p>Error: <a href="https://docs.astral.sh/ruff/rules/#{ruff_ref}">{ruff_ref}</a>{message}</p>'
77
+ )
77
78
 
78
79
  elif "\\" in line and ":" in line and len(code_part) > 0:
79
80
  h3_file = line.replace("\\", "/")
@@ -9,3 +9,7 @@ def main() -> None:
9
9
  This function calls the pre_commit_html method from the PreCommitParser class.
10
10
  """
11
11
  PreCommitParser.pre_commit_html()
12
+
13
+
14
+ if __name__ == "__main__":
15
+ SystemExit(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pre_commit_html
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Format results from pre-commit cmd to HTML file
5
5
  License: MIT
6
6
  Author: Robotz213
@@ -0,0 +1,11 @@
1
+ pre_commit_html/__init__.py,sha256=W30OYPhTtrsoGH_xbIFRGO8IpDKcL5OEdobZLqYXYrM,4364
2
+ pre_commit_html/__main__.py,sha256=ME8XDYKL00PsCgA96rYrGqzujMCu5FiUPVZo5VyiZ6w,367
3
+ pre_commit_html/site/nothing,sha256=FgEEp-DgpF7jCB5mTtiWk_6yQcNz6q68-hqvGHulRbA,15
4
+ pre_commit_html/site/templates/code_error.jinja,sha256=Nca684pgieEMbgrHFEl7acf26-e5LpGQIYFMDfyHoZ0,52
5
+ pre_commit_html/site/templates/code_part.jinja,sha256=ZmTKj9Ev1_yDoUQJlZ1RQZb1-VYDOSkN2sNvwbnfng0,111
6
+ pre_commit_html/site/templates/html_content.jinja,sha256=9dmoVLZ-BmYEf27j_52F6md23WS_5JshkTqO9VpRvX0,1695
7
+ pre_commit_html-0.1.2.dist-info/LICENSE,sha256=3V9deIJXT--GYubOVNXj1madYOvijNEIn03Yh6ChvPI,1066
8
+ pre_commit_html-0.1.2.dist-info/METADATA,sha256=SRNwXpJjTDfIWzwLcFsu_AcjfQW4YXIVZuTaGtnAVcw,2926
9
+ pre_commit_html-0.1.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
10
+ pre_commit_html-0.1.2.dist-info/entry_points.txt,sha256=qosHLsMCjOyjqzpzxw7GKkNQ5RzBxXAh6sFjINUHpMM,60
11
+ pre_commit_html-0.1.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ pre_commit_html=pre_commit_html:__main__
3
+
@@ -1,10 +0,0 @@
1
- pre_commit_html/__init__.py,sha256=E4lwFOTo62ty9IO7bHwAfWi43aYnXB3pRunP9MRrENg,4251
2
- pre_commit_html/__main__.py,sha256=4x-U3lLq6mNLINz0L6YAS2uMDmk8L0KVm2bCDc_9CrY,315
3
- pre_commit_html/site/nothing,sha256=FgEEp-DgpF7jCB5mTtiWk_6yQcNz6q68-hqvGHulRbA,15
4
- pre_commit_html/site/templates/code_error.jinja,sha256=Nca684pgieEMbgrHFEl7acf26-e5LpGQIYFMDfyHoZ0,52
5
- pre_commit_html/site/templates/code_part.jinja,sha256=ZmTKj9Ev1_yDoUQJlZ1RQZb1-VYDOSkN2sNvwbnfng0,111
6
- pre_commit_html/site/templates/html_content.jinja,sha256=9dmoVLZ-BmYEf27j_52F6md23WS_5JshkTqO9VpRvX0,1695
7
- pre_commit_html-0.1.1.dist-info/LICENSE,sha256=3V9deIJXT--GYubOVNXj1madYOvijNEIn03Yh6ChvPI,1066
8
- pre_commit_html-0.1.1.dist-info/METADATA,sha256=rNYl2-gxKmM0ICFg4qQQGZgHJ81MnLy6X_SA_fTR4Rw,2926
9
- pre_commit_html-0.1.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
10
- pre_commit_html-0.1.1.dist-info/RECORD,,