Markdown-Checker 0.2.3__tar.gz → 0.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.
- {markdown_checker-0.2.3/src/markdown_checker.egg-info → markdown_checker-0.2.4}/PKG-INFO +2 -2
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/pyproject.toml +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/__init__.py +7 -24
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/templates/paths/broken.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/templates/paths/tracking.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/templates/urls/broken.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/templates/urls/locale.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/templates/urls/tracking.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/urls.py +9 -5
- markdown_checker-0.2.4/src/markdown_checker/utils/logging.py +19 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4/src/markdown_checker.egg-info}/PKG-INFO +2 -2
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/SOURCES.txt +1 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/LICENSE +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/README.md +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/setup.cfg +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/markdown_link_base.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/paths.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/py.typed +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/generator_base.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/md_reports/generator.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/extract_links.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/format_output.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/list_files.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/spinner.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/dependency_links.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/entry_points.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/requires.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/top_level.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.4}/tests/test_markdown_checker.py +0 -0
|
@@ -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.
|
|
4
|
+
version = "0.2.4"
|
|
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,15 @@ def detect_issues(
|
|
|
76
76
|
# currently these domains are known to have restrictions on the requests
|
|
77
77
|
skip_domains.extend(
|
|
78
78
|
[
|
|
79
|
-
"
|
|
80
|
-
"help.openai.com",
|
|
79
|
+
"openai.com",
|
|
81
80
|
"beta.openai.com",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
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
|
-
"
|
|
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",
|
|
105
88
|
]
|
|
106
89
|
)
|
|
107
90
|
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
@@ -260,7 +243,7 @@ class ListOfStrings(click.Option):
|
|
|
260
243
|
"-to",
|
|
261
244
|
"--timeout",
|
|
262
245
|
type=click.IntRange(0, 50),
|
|
263
|
-
default=
|
|
246
|
+
default=15,
|
|
264
247
|
help="Timeout in seconds for the requests.",
|
|
265
248
|
required=False,
|
|
266
249
|
)
|
|
@@ -289,7 +272,7 @@ class ListOfStrings(click.Option):
|
|
|
289
272
|
required=False,
|
|
290
273
|
)
|
|
291
274
|
@click.version_option(
|
|
292
|
-
message=(f"%(prog)s, %(version)s\
|
|
275
|
+
message=(f"%(prog)s, %(version)s\nPython ({platform.python_implementation()}) {platform.python_version()}"),
|
|
293
276
|
)
|
|
294
277
|
def main(
|
|
295
278
|
src: tuple[Path, ...],
|
|
@@ -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.
|
|
@@ -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 =
|
|
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
|
|
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
|
|
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)
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/markdown_link_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/reports/generator_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/extract_links.py
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker/utils/format_output.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/requires.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.4}/src/markdown_checker.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|