Markdown-Checker 0.2.3__tar.gz → 0.2.5__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 (32) hide show
  1. {markdown_checker-0.2.3/src/markdown_checker.egg-info → markdown_checker-0.2.5}/PKG-INFO +3 -2
  2. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/pyproject.toml +1 -1
  3. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/__init__.py +9 -25
  4. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/paths/broken.md +1 -1
  5. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/paths/tracking.md +1 -1
  6. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/broken.md +1 -1
  7. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/locale.md +1 -1
  8. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/tracking.md +1 -1
  9. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/urls.py +9 -5
  10. markdown_checker-0.2.5/src/markdown_checker/utils/logging.py +19 -0
  11. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/spinner.py +1 -1
  12. {markdown_checker-0.2.3 → markdown_checker-0.2.5/src/markdown_checker.egg-info}/PKG-INFO +3 -2
  13. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/SOURCES.txt +1 -0
  14. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/LICENSE +0 -0
  15. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/README.md +0 -0
  16. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/setup.cfg +0 -0
  17. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/markdown_link_base.py +0 -0
  18. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/paths.py +0 -0
  19. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/py.typed +0 -0
  20. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/__init__.py +0 -0
  21. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/generator_base.py +0 -0
  22. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/__init__.py +0 -0
  23. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/generator.py +0 -0
  24. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/__init__.py +0 -0
  25. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/extract_links.py +0 -0
  26. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/format_output.py +0 -0
  27. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/list_files.py +0 -0
  28. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/dependency_links.txt +0 -0
  29. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/entry_points.txt +0 -0
  30. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/requires.txt +0 -0
  31. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/top_level.txt +0 -0
  32. {markdown_checker-0.2.3 → markdown_checker-0.2.5}/tests/test_markdown_checker.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: markdown-checker
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A markdown link validation reporting tool.
5
5
  Author-email: John Aziz <johnaziz269@gmail.com>
6
6
  Maintainer-email: John Aziz <johnaziz269@gmail.com>
@@ -62,6 +62,7 @@ Requires-Dist: mkdocs; extra == "docs"
62
62
  Requires-Dist: mkdocs-material; extra == "docs"
63
63
  Requires-Dist: mkdocstrings[python]; extra == "docs"
64
64
  Requires-Dist: pymdown-extensions; extra == "docs"
65
+ Dynamic: license-file
65
66
 
66
67
  [![PyPi](https://img.shields.io/pypi/v/markdown-checker)](https://pypi.org/project/markdown-checker/)
67
68
  [![Documentation Status](https://readthedocs.org/projects/markdown-checker/badge/?version=latest)](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "markdown-checker"
3
3
  description= "A markdown link validation reporting tool."
4
- version = "0.2.3"
4
+ version = "0.2.5"
5
5
  authors = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
6
6
  maintainers = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
7
7
  license = {file = "LICENSE"}
@@ -76,32 +76,16 @@ def detect_issues(
76
76
  # currently these domains are known to have restrictions on the requests
77
77
  skip_domains.extend(
78
78
  [
79
- "platform.openai.com",
80
- "help.openai.com",
79
+ "openai.com",
81
80
  "beta.openai.com",
82
- "marketplace.visualstudio.com",
83
- "huggingface.co",
81
+ "help.openai.com",
82
+ "platform.openai.com",
83
+ "vscode.dev",
84
84
  "en.wikipedia.org",
85
- "twitter.com",
86
- "www.linkedin.com",
87
- "make.powerautomate.com",
88
- "make.powerapps.com",
89
85
  "www.midjourney.com",
90
- "vscode.dev",
86
+ "www.linkedin.com",
91
87
  "rodtrent.substack.com",
92
- "example.com",
93
- "www.nuget.org",
94
- "www.docker.com",
95
- "build.nvidia.com",
96
- "dotnet.microsoft.com",
97
- "www.gemini.com",
98
- "upload.wikimedia.org",
99
- "medium.com",
100
- "blogs.nvidia.com",
101
- "blog.gopenai.com",
102
- "towardsdatascience.com",
103
- "code.visualstudio.com",
104
- "opensource.org",
88
+ "github.com",
105
89
  ]
106
90
  )
107
91
  with concurrent.futures.ProcessPoolExecutor() as executor:
@@ -165,7 +149,7 @@ class ListOfStrings(click.Option):
165
149
  Ref: https://stackoverflow.com/questions/47631914/how-to-pass-several-list-of-arguments-to-click-option
166
150
  """
167
151
 
168
- def type_cast_value(self, ctx, value):
152
+ def type_cast_value(self, ctx, value) -> list[str]: # type: ignore
169
153
  try:
170
154
  if isinstance(value, str):
171
155
  # split the string by comma and remove empty strings
@@ -260,7 +244,7 @@ class ListOfStrings(click.Option):
260
244
  "-to",
261
245
  "--timeout",
262
246
  type=click.IntRange(0, 50),
263
- default=10,
247
+ default=15,
264
248
  help="Timeout in seconds for the requests.",
265
249
  required=False,
266
250
  )
@@ -289,7 +273,7 @@ class ListOfStrings(click.Option):
289
273
  required=False,
290
274
  )
291
275
  @click.version_option(
292
- message=(f"%(prog)s, %(version)s\n" f"Python ({platform.python_implementation()}) {platform.python_version()}"),
276
+ message=(f"%(prog)s, %(version)s\nPython ({platform.python_implementation()}) {platform.python_version()}"),
293
277
  )
294
278
  def main(
295
279
  src: tuple[Path, ...],
@@ -3,4 +3,4 @@
3
3
  We have automatically detected the following broken relative paths in your files.
4
4
  Review and fix the paths to resolve this issue.
5
5
 
6
- Check the file paths and associated broken paths inside them.
6
+ Check the file paths and associated broken paths inside them.
@@ -3,4 +3,4 @@
3
3
  We have automatically detected missing tracking IDs from the following relative paths in your files.
4
4
  Review and add tracking to paths to resolve this issue.
5
5
 
6
- Check the file paths and associated paths inside them.
6
+ Check the file paths and associated paths inside them.
@@ -2,4 +2,4 @@
2
2
 
3
3
  We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.
4
4
 
5
- Check the file paths and associated broken URLs inside them.
5
+ Check the file paths and associated broken URLs inside them.
@@ -3,4 +3,4 @@
3
3
  We have automatically detected added country locale to URLs in your files.
4
4
  Review and remove country-specific locale from URLs to resolve this issue.
5
5
 
6
- Check the file paths and associated URLs inside them.
6
+ Check the file paths and associated URLs inside them.
@@ -3,4 +3,4 @@
3
3
  We have automatically detected missing tracking IDs from the following URLs in your files.
4
4
  Review and add tracking to URLs to resolve this issue.
5
5
 
6
- Check the file paths and associated URLs inside them.
6
+ Check the file paths and associated URLs inside them.
@@ -27,7 +27,7 @@ class MarkdownURL(MarkdownLinkBase):
27
27
  """
28
28
  return self.parsed_url.netloc
29
29
 
30
- def is_alive(self, timeout: int = 10, retries: int = 3) -> bool:
30
+ def is_alive(self, timeout: int = 15, retries: int = 3) -> bool:
31
31
  """
32
32
  Check if the URL is alive
33
33
 
@@ -38,14 +38,18 @@ class MarkdownURL(MarkdownLinkBase):
38
38
  Returns:
39
39
  bool: True if the URL is alive, False otherwise
40
40
  """
41
+ headers = {
42
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
43
+ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
44
+ }
41
45
  for _ in range(retries):
42
46
  try:
43
- response = requests.head(self.link, timeout=timeout, allow_redirects=True)
44
- if response.status_code == 200:
47
+ response = requests.head(self.link, timeout=timeout, allow_redirects=True, headers=headers)
48
+ if 200 <= response.status_code < 300:
45
49
  return True
46
50
  else:
47
- response = requests.get(self.link, timeout=timeout, allow_redirects=True)
48
- if response.status_code == 200:
51
+ response = requests.get(self.link, timeout=timeout, allow_redirects=True, headers=headers)
52
+ if 200 <= response.status_code < 300:
49
53
  return True
50
54
  except requests.RequestException:
51
55
  continue
@@ -0,0 +1,19 @@
1
+ """
2
+ Utilities for logging config.
3
+ """
4
+
5
+ import logging
6
+
7
+
8
+ def setup_logging(
9
+ level: int = logging.INFO,
10
+ format: str = "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
11
+ ) -> None:
12
+ """
13
+ Setup logging
14
+
15
+ Args:
16
+ level (int): The logging level
17
+ format (str): The logging format
18
+ """
19
+ logging.basicConfig(level=level, format=format)
@@ -44,7 +44,7 @@ class Spinner:
44
44
  self.start()
45
45
  return self
46
46
 
47
- def __exit__(self, exc_type, exc_val, exc_tb):
47
+ def __exit__(self, exc_type, exc_val, exc_tb): # type: ignore
48
48
  if self.disable:
49
49
  return False
50
50
  self.stop()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: markdown-checker
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A markdown link validation reporting tool.
5
5
  Author-email: John Aziz <johnaziz269@gmail.com>
6
6
  Maintainer-email: John Aziz <johnaziz269@gmail.com>
@@ -62,6 +62,7 @@ Requires-Dist: mkdocs; extra == "docs"
62
62
  Requires-Dist: mkdocs-material; extra == "docs"
63
63
  Requires-Dist: mkdocstrings[python]; extra == "docs"
64
64
  Requires-Dist: pymdown-extensions; extra == "docs"
65
+ Dynamic: license-file
65
66
 
66
67
  [![PyPi](https://img.shields.io/pypi/v/markdown-checker)](https://pypi.org/project/markdown-checker/)
67
68
  [![Documentation Status](https://readthedocs.org/projects/markdown-checker/badge/?version=latest)](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
@@ -25,5 +25,6 @@ src/markdown_checker/utils/__init__.py
25
25
  src/markdown_checker/utils/extract_links.py
26
26
  src/markdown_checker/utils/format_output.py
27
27
  src/markdown_checker/utils/list_files.py
28
+ src/markdown_checker/utils/logging.py
28
29
  src/markdown_checker/utils/spinner.py
29
30
  tests/test_markdown_checker.py