Markdown-Checker 0.1.2__tar.gz → 0.1.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.1.4/PKG-INFO +148 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4}/README.md +42 -13
- markdown_checker-0.1.4/pyproject.toml +65 -0
- markdown_checker-0.1.4/setup.cfg +4 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/check_markdown.py +6 -3
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/generators/md_generator.py +16 -24
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/inputs/input_arguments.py +1 -1
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/links/link_operations.py +20 -26
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/paths/files_paths_reader.py +9 -7
- markdown_checker-0.1.4/src/markdown_checker/py.typed +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/validate_markdown.py +3 -5
- markdown_checker-0.1.4/src/markdown_checker.egg-info/PKG-INFO +148 -0
- markdown_checker-0.1.4/src/markdown_checker.egg-info/SOURCES.txt +22 -0
- markdown_checker-0.1.4/src/markdown_checker.egg-info/requires.txt +10 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4}/tests/test_markdown_checker.py +15 -7
- markdown-checker-0.1.2/MANIFEST.in +0 -6
- markdown-checker-0.1.2/PKG-INFO +0 -88
- markdown-checker-0.1.2/markdown_checker.egg-info/PKG-INFO +0 -88
- markdown-checker-0.1.2/markdown_checker.egg-info/SOURCES.txt +0 -24
- markdown-checker-0.1.2/markdown_checker.egg-info/requires.txt +0 -1
- markdown-checker-0.1.2/pyproject.toml +0 -3
- markdown-checker-0.1.2/setup.cfg +0 -40
- markdown-checker-0.1.2/setup.py +0 -3
- {markdown-checker-0.1.2 → markdown_checker-0.1.4}/LICENSE +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/__init__.py +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/generators/__init__.py +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/inputs/__init__.py +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/links/__init__.py +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/paths/__init__.py +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/dependency_links.txt +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/entry_points.txt +0 -0
- {markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: markdown-checker
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A markdown link validation reporting tool
|
|
5
|
+
Author-email: John Aziz <johnaziz269@gmail.com>
|
|
6
|
+
Maintainer-email: John Aziz <johnaziz269@gmail.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2023 John Aziz
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/john0isaac/markdown-checker
|
|
30
|
+
Project-URL: Documentation, https://markdown-checker.readthedocs.io/en/latest/
|
|
31
|
+
Project-URL: Issues, https://github.com/john0isaac/markdown-checker/issues
|
|
32
|
+
Project-URL: Contributing, https://github.com/john0isaac/markdown-checker/pulls
|
|
33
|
+
Project-URL: Releases, https://github.com/john0isaac/markdown-checker/releases
|
|
34
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Requires-Python: >=3.8
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: requests
|
|
47
|
+
Requires-Dist: types-requests
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: pytest; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff; extra == "dev"
|
|
53
|
+
Requires-Dist: black; extra == "dev"
|
|
54
|
+
Requires-Dist: mypy; extra == "dev"
|
|
55
|
+
|
|
56
|
+
[](https://pypi.org/project/markdown-checker/)
|
|
57
|
+
[](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
|
|
58
|
+
[](https://pypi.org/project/markdown-checker/)
|
|
59
|
+
|
|
60
|
+
[](https://github.com/john0isaac/markdown-checker/issues)
|
|
61
|
+
[](https://github.com/john0isaac/markdown-checker/pulls)
|
|
62
|
+
|
|
63
|
+
markdown-checker is a markdown link validation reporting tool. It provides a couple of functions to validate relative paths and web URLs.
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
Install the package:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install markdown-checker
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Documentation
|
|
74
|
+
|
|
75
|
+
- [Full documentation](https://markdown-checker.readthedocs.io/en/latest/).
|
|
76
|
+
|
|
77
|
+
## 1, 2, 3 - How To
|
|
78
|
+
|
|
79
|
+
1. Run `pip install markdown-checker`.
|
|
80
|
+
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, `{func}` with the available functions like `check_broken_paths`, `{gu}` with your contribution guidance full URL.
|
|
81
|
+
3. The output will be displayed in the terminal and in a `comments.md` file.
|
|
82
|
+
|
|
83
|
+
## Using `markdown-checker` in GitHub Actions
|
|
84
|
+
|
|
85
|
+
You can run this tool within a GitHub workflow using the [action-check-markdown](https://github.com/marketplace/actions/check-markdown) GitHub action.
|
|
86
|
+
|
|
87
|
+
The action will automatically post the output of the tool to your GitHub pull request as a comment.
|
|
88
|
+
|
|
89
|
+
# Usage
|
|
90
|
+
|
|
91
|
+
The library provides the following functions:
|
|
92
|
+
|
|
93
|
+
- [Usage](#usage)
|
|
94
|
+
- [`check_broken_paths`](#check_broken_paths)
|
|
95
|
+
- [`check_broken_urls`](#check_broken_urls)
|
|
96
|
+
- [`check_urls_locale`](#check_urls_locale)
|
|
97
|
+
- [`check_paths_tracking`](#check_paths_tracking)
|
|
98
|
+
- [`check_urls_tracking`](#check_urls_tracking)
|
|
99
|
+
|
|
100
|
+
## `check_broken_paths`
|
|
101
|
+
|
|
102
|
+
This function ensures that any relative path in your files are working.
|
|
103
|
+
|
|
104
|
+
Example:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
markdown-checker -d . -f check_broken_paths -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## `check_broken_urls`
|
|
111
|
+
|
|
112
|
+
This function ensures that any web URL in your files is working and returning 200 status code.
|
|
113
|
+
|
|
114
|
+
Example:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
markdown-checker -d . -f check_broken_urls -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## `check_urls_locale`
|
|
121
|
+
|
|
122
|
+
This function checks if country specific locale is present in URLs.
|
|
123
|
+
|
|
124
|
+
Example:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
markdown-checker -d . -f check_urls_locale -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## `check_paths_tracking`
|
|
131
|
+
|
|
132
|
+
This function ensures that any relative path has tracking in it.
|
|
133
|
+
|
|
134
|
+
Example:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
markdown-checker -d . -f check_paths_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## `check_urls_tracking`
|
|
141
|
+
|
|
142
|
+
This function ensures that any URL has tracking in it.
|
|
143
|
+
|
|
144
|
+
Example:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
markdown-checker -d . -f check_urls_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
148
|
+
```
|
|
@@ -1,25 +1,50 @@
|
|
|
1
1
|
[](https://pypi.org/project/markdown-checker/)
|
|
2
|
+
[](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
|
|
2
3
|
[](https://pypi.org/project/markdown-checker/)
|
|
3
4
|
|
|
4
5
|
[](https://github.com/john0isaac/markdown-checker/issues)
|
|
5
6
|
[](https://github.com/john0isaac/markdown-checker/pulls)
|
|
6
7
|
|
|
7
|
-
markdown-checker is a markdown validation reporting tool.
|
|
8
|
+
markdown-checker is a markdown link validation reporting tool. It provides a couple of functions to validate relative paths and web URLs.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Install the package:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install markdown-checker
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Documentation
|
|
19
|
+
|
|
20
|
+
- [Full documentation](https://markdown-checker.readthedocs.io/en/latest/).
|
|
21
|
+
|
|
22
|
+
## 1, 2, 3 - How To
|
|
10
23
|
|
|
11
24
|
1. Run `pip install markdown-checker`.
|
|
12
|
-
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, {func} with the available functions like check_broken_paths
|
|
25
|
+
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, `{func}` with the available functions like `check_broken_paths`, `{gu}` with your contribution guidance full URL.
|
|
13
26
|
3. The output will be displayed in the terminal and in a `comments.md` file.
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
## Using `markdown-checker` in GitHub Actions
|
|
29
|
+
|
|
30
|
+
You can run this tool within a GitHub workflow using the [action-check-markdown](https://github.com/marketplace/actions/check-markdown) GitHub action.
|
|
16
31
|
|
|
17
|
-
The
|
|
32
|
+
The action will automatically post the output of the tool to your GitHub pull request as a comment.
|
|
18
33
|
|
|
19
|
-
#
|
|
34
|
+
# Usage
|
|
20
35
|
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
The library provides the following functions:
|
|
37
|
+
|
|
38
|
+
- [Usage](#usage)
|
|
39
|
+
- [`check_broken_paths`](#check_broken_paths)
|
|
40
|
+
- [`check_broken_urls`](#check_broken_urls)
|
|
41
|
+
- [`check_urls_locale`](#check_urls_locale)
|
|
42
|
+
- [`check_paths_tracking`](#check_paths_tracking)
|
|
43
|
+
- [`check_urls_tracking`](#check_urls_tracking)
|
|
44
|
+
|
|
45
|
+
## `check_broken_paths`
|
|
46
|
+
|
|
47
|
+
This function ensures that any relative path in your files are working.
|
|
23
48
|
|
|
24
49
|
Example:
|
|
25
50
|
|
|
@@ -27,7 +52,8 @@ Example:
|
|
|
27
52
|
markdown-checker -d . -f check_broken_paths -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
28
53
|
```
|
|
29
54
|
|
|
30
|
-
##
|
|
55
|
+
## `check_broken_urls`
|
|
56
|
+
|
|
31
57
|
This function ensures that any web URL in your files is working and returning 200 status code.
|
|
32
58
|
|
|
33
59
|
Example:
|
|
@@ -36,8 +62,9 @@ Example:
|
|
|
36
62
|
markdown-checker -d . -f check_broken_urls -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
37
63
|
```
|
|
38
64
|
|
|
39
|
-
##
|
|
40
|
-
|
|
65
|
+
## `check_urls_locale`
|
|
66
|
+
|
|
67
|
+
This function checks if country specific locale is present in URLs.
|
|
41
68
|
|
|
42
69
|
Example:
|
|
43
70
|
|
|
@@ -45,7 +72,8 @@ Example:
|
|
|
45
72
|
markdown-checker -d . -f check_urls_locale -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
46
73
|
```
|
|
47
74
|
|
|
48
|
-
##
|
|
75
|
+
## `check_paths_tracking`
|
|
76
|
+
|
|
49
77
|
This function ensures that any relative path has tracking in it.
|
|
50
78
|
|
|
51
79
|
Example:
|
|
@@ -54,7 +82,8 @@ Example:
|
|
|
54
82
|
markdown-checker -d . -f check_paths_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
55
83
|
```
|
|
56
84
|
|
|
57
|
-
##
|
|
85
|
+
## `check_urls_tracking`
|
|
86
|
+
|
|
58
87
|
This function ensures that any URL has tracking in it.
|
|
59
88
|
|
|
60
89
|
Example:
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "markdown-checker"
|
|
7
|
+
description= "A markdown link validation reporting tool"
|
|
8
|
+
version = "0.1.4"
|
|
9
|
+
authors = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
|
|
10
|
+
maintainers = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
|
|
14
|
+
requires-python = ">=3.8"
|
|
15
|
+
dependencies = [
|
|
16
|
+
"requests",
|
|
17
|
+
"types-requests",
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 5 - Production/Stable",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.8",
|
|
25
|
+
"Programming Language :: Python :: 3.9",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/john0isaac/markdown-checker"
|
|
33
|
+
Documentation = "https://markdown-checker.readthedocs.io/en/latest/"
|
|
34
|
+
Issues = "https://github.com/john0isaac/markdown-checker/issues"
|
|
35
|
+
Contributing = "https://github.com/john0isaac/markdown-checker/pulls"
|
|
36
|
+
Releases = "https://github.com/john0isaac/markdown-checker/releases"
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.package-data]
|
|
39
|
+
"*" = ["*.html", "*.txt", "*.xml", "*.md"]
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
dev = [
|
|
43
|
+
"pytest",
|
|
44
|
+
"pytest-cov",
|
|
45
|
+
"pre-commit",
|
|
46
|
+
"ruff",
|
|
47
|
+
"black",
|
|
48
|
+
"mypy",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[tool.ruff]
|
|
52
|
+
line-length = 120
|
|
53
|
+
target-version = "py38"
|
|
54
|
+
src = ["src"]
|
|
55
|
+
output-format = "full"
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint]
|
|
58
|
+
select = ["E", "F", "I", "UP"]
|
|
59
|
+
|
|
60
|
+
[tool.black]
|
|
61
|
+
line-length = 120
|
|
62
|
+
target-version = ["py38"]
|
|
63
|
+
|
|
64
|
+
[project.scripts]
|
|
65
|
+
markdown-checker = "markdown_checker.validate_markdown:main"
|
|
@@ -3,6 +3,8 @@ Module providing automatic checks functionality to markdown files
|
|
|
3
3
|
following some Guidelines
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
from typing import List
|
|
7
|
+
|
|
6
8
|
from markdown_checker.links.link_operations import (
|
|
7
9
|
check_paths_exists,
|
|
8
10
|
check_url_alive,
|
|
@@ -57,14 +59,15 @@ def check_broken_links(file_path: str, link_type: str, check_type: str) -> str:
|
|
|
57
59
|
if len(dead_urls) > 0:
|
|
58
60
|
formatted_output += format_links(dead_urls)
|
|
59
61
|
return formatted_output
|
|
62
|
+
return ""
|
|
60
63
|
|
|
61
64
|
|
|
62
|
-
def format_links(links:
|
|
65
|
+
def format_links(links: List[str]) -> str:
|
|
63
66
|
"""
|
|
64
|
-
Formats a
|
|
67
|
+
Formats a List of links into a string with numbered bullets.
|
|
65
68
|
|
|
66
69
|
Args:
|
|
67
|
-
links (
|
|
70
|
+
links (List): A List of links.
|
|
68
71
|
|
|
69
72
|
Returns:
|
|
70
73
|
str: The formatted string with numbered bullets.
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/generators/md_generator.py
RENAMED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
CHECK_BROKEN_PATHS = """# Check Broken Paths
|
|
2
2
|
|
|
3
|
-
We have automatically detected the following broken relative paths in your
|
|
3
|
+
We have automatically detected the following broken relative paths in your files.
|
|
4
|
+
Review and fix the paths to resolve this issue.
|
|
4
5
|
|
|
5
6
|
Check the file paths and associated broken paths inside them."""
|
|
6
7
|
CHECK_BROKEN_URLS = """# Check Broken URLs
|
|
7
8
|
|
|
8
|
-
We have automatically detected the following broken URLs in your
|
|
9
|
+
We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.
|
|
9
10
|
|
|
10
|
-
Check the file paths and associated broken
|
|
11
|
+
Check the file paths and associated broken URLs inside them."""
|
|
11
12
|
CHECK_PATHS_TRACKING = """# Check Missing Tracking from Paths
|
|
12
13
|
|
|
13
|
-
We have automatically detected missing tracking
|
|
14
|
+
We have automatically detected missing tracking IDs from the following relative paths in your files.
|
|
15
|
+
Review and add tracking to paths to resolve this issue.
|
|
14
16
|
|
|
15
17
|
Check the file paths and associated paths inside them."""
|
|
16
18
|
CHECK_URLS_TRACKING = """# Check Missing Tracking from URLs
|
|
17
19
|
|
|
18
|
-
We have automatically detected missing tracking
|
|
20
|
+
We have automatically detected missing tracking IDs from the following URLs in your files.
|
|
21
|
+
Review and add tracking to URLs to resolve this issue.
|
|
19
22
|
|
|
20
23
|
Check the file paths and associated URLs inside them."""
|
|
21
24
|
CHECK_URLS_LOCALE = """# Check Country Locale in URLs
|
|
22
25
|
|
|
23
|
-
We have automatically detected added country locale to URLs in your
|
|
26
|
+
We have automatically detected added country locale to URLs in your files.
|
|
27
|
+
Review and remove country-specific locale from URLs to resolve this issue.
|
|
24
28
|
|
|
25
29
|
Check the file paths and associated URLs inside them."""
|
|
26
30
|
|
|
@@ -31,9 +35,7 @@ def write_md_file(generated_md: str) -> None:
|
|
|
31
35
|
file.write(generated_md)
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
def generate_md(
|
|
35
|
-
formatted_output: str, function_name: str, contributing_guide_url: str
|
|
36
|
-
) -> None:
|
|
38
|
+
def generate_md(formatted_output: str, function_name: str, contributing_guide_url: str) -> None:
|
|
37
39
|
"""Generate markdown file based on the formatted output, function name, and contributing guide URL.
|
|
38
40
|
|
|
39
41
|
Args:
|
|
@@ -47,25 +49,15 @@ def generate_md(
|
|
|
47
49
|
"""
|
|
48
50
|
contributing_guide_line = f" For more details, check our [Contributing Guide]({contributing_guide_url}).\n\n"
|
|
49
51
|
if function_name == "check_broken_paths":
|
|
50
|
-
formatted_output =
|
|
51
|
-
CHECK_BROKEN_PATHS + contributing_guide_line + formatted_output
|
|
52
|
-
)
|
|
52
|
+
formatted_output = CHECK_BROKEN_PATHS + contributing_guide_line + formatted_output
|
|
53
53
|
elif function_name == "check_broken_urls":
|
|
54
|
-
formatted_output =
|
|
55
|
-
CHECK_BROKEN_URLS + contributing_guide_line + formatted_output
|
|
56
|
-
)
|
|
54
|
+
formatted_output = CHECK_BROKEN_URLS + contributing_guide_line + formatted_output
|
|
57
55
|
elif function_name == "check_paths_tracking":
|
|
58
|
-
formatted_output =
|
|
59
|
-
CHECK_PATHS_TRACKING + contributing_guide_line + formatted_output
|
|
60
|
-
)
|
|
56
|
+
formatted_output = CHECK_PATHS_TRACKING + contributing_guide_line + formatted_output
|
|
61
57
|
elif function_name == "check_urls_tracking":
|
|
62
|
-
formatted_output =
|
|
63
|
-
CHECK_URLS_TRACKING + contributing_guide_line + formatted_output
|
|
64
|
-
)
|
|
58
|
+
formatted_output = CHECK_URLS_TRACKING + contributing_guide_line + formatted_output
|
|
65
59
|
elif function_name == "check_urls_locale":
|
|
66
|
-
formatted_output =
|
|
67
|
-
CHECK_URLS_LOCALE + contributing_guide_line + formatted_output
|
|
68
|
-
)
|
|
60
|
+
formatted_output = CHECK_URLS_LOCALE + contributing_guide_line + formatted_output
|
|
69
61
|
else:
|
|
70
62
|
raise ValueError("Invalid function name")
|
|
71
63
|
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/inputs/input_arguments.py
RENAMED
|
@@ -6,7 +6,7 @@ following some Guidelines
|
|
|
6
6
|
import argparse
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def get_input_args() ->
|
|
9
|
+
def get_input_args() -> argparse.Namespace:
|
|
10
10
|
"""
|
|
11
11
|
Retrieves and parses the 2 command line arguments provided by the user when
|
|
12
12
|
they run the program from a terminal window. This function uses Python's
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/links/link_operations.py
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
|
+
from typing import List
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
def get_links_from_file(file_path: str) ->
|
|
6
|
+
def get_links_from_file(file_path: str) -> List[str]:
|
|
6
7
|
"""function to get an array of markdown links from a file
|
|
7
8
|
flags markdown links captures the part inside () that comes right after []
|
|
8
9
|
"""
|
|
9
10
|
all_links = []
|
|
10
|
-
with open(file_path,
|
|
11
|
+
with open(file_path, encoding="utf-8") as file:
|
|
11
12
|
data = file.read()
|
|
12
13
|
link_pattern = re.compile(r"\]\((.*?)\)| \)")
|
|
13
14
|
matches = re.finditer(link_pattern, data)
|
|
@@ -17,8 +18,8 @@ def get_links_from_file(file_path: str) -> list:
|
|
|
17
18
|
return all_links
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
def get_urls_from_links(all_links:
|
|
21
|
-
"""function to get an array of urls from a
|
|
21
|
+
def get_urls_from_links(all_links: List[str]) -> List[str]:
|
|
22
|
+
"""function to get an array of urls from a List"""
|
|
22
23
|
urls = []
|
|
23
24
|
url_pattern = re.compile(
|
|
24
25
|
r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9]{1,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)"
|
|
@@ -38,8 +39,8 @@ def get_urls_from_links(all_links: list) -> list:
|
|
|
38
39
|
return urls
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
def get_paths_from_links(all_links:
|
|
42
|
-
"""function to get relative paths from a
|
|
42
|
+
def get_paths_from_links(all_links: List[str]) -> List[str]:
|
|
43
|
+
"""function to get relative paths from a List
|
|
43
44
|
flags paths that start with ./ or ../
|
|
44
45
|
"""
|
|
45
46
|
paths = []
|
|
@@ -49,34 +50,29 @@ def get_paths_from_links(all_links: list) -> list:
|
|
|
49
50
|
link = link.split(" ")[0]
|
|
50
51
|
matches = re.findall(path_pattern, link)
|
|
51
52
|
if matches:
|
|
52
|
-
paths.append(link)
|
|
53
|
+
paths.append(link.split("#")[0])
|
|
53
54
|
return paths
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
def check_paths_exists(file_path: str, paths:
|
|
57
|
+
def check_paths_exists(file_path: str, paths: List[str]) -> List[str]:
|
|
57
58
|
"""function checks if a path exist if not return non existent paths
|
|
58
59
|
flags any relative path that can't be accessed
|
|
59
60
|
"""
|
|
60
61
|
broken_path = []
|
|
61
62
|
for path in paths:
|
|
62
63
|
path = re.sub(r"(\?|\&)(WT|wt)\.mc_id=.*", "", path)
|
|
63
|
-
if not os.path.exists(
|
|
64
|
-
os.path.normpath(os.path.join(os.path.dirname(file_path), path))
|
|
65
|
-
):
|
|
64
|
+
if not os.path.exists(os.path.normpath(os.path.join(os.path.dirname(file_path), path))):
|
|
66
65
|
broken_path.append(path)
|
|
67
66
|
return broken_path
|
|
68
67
|
|
|
69
68
|
|
|
70
|
-
def check_url_locale(urls:
|
|
69
|
+
def check_url_locale(urls: List[str]) -> List[str]:
|
|
71
70
|
"""function checks if a url has country locale
|
|
72
71
|
flags urls that have ==> /en-us/
|
|
73
72
|
"""
|
|
74
73
|
country_locale = []
|
|
75
74
|
for url in urls:
|
|
76
|
-
if
|
|
77
|
-
"video-embed.html" in url
|
|
78
|
-
or "https://www.microsoft.com/en-us/security/blog" in url
|
|
79
|
-
):
|
|
75
|
+
if "video-embed.html" in url or "https://www.microsoft.com/en-us/security/blog" in url:
|
|
80
76
|
continue
|
|
81
77
|
locale_pattern = re.compile(r"\/[a-z]{2}-[a-z]{2}\/")
|
|
82
78
|
matches = re.findall(locale_pattern, url)
|
|
@@ -85,7 +81,7 @@ def check_url_locale(urls: list) -> list:
|
|
|
85
81
|
return country_locale
|
|
86
82
|
|
|
87
83
|
|
|
88
|
-
def check_url_tracking(urls:
|
|
84
|
+
def check_url_tracking(urls: List[str]) -> List[str]:
|
|
89
85
|
"""function checks if a url has tracking id
|
|
90
86
|
flags urls missing ==> (? or &) plus WT.mc_id= or wt.mc_id=
|
|
91
87
|
"""
|
|
@@ -98,8 +94,8 @@ def check_url_tracking(urls: list) -> list:
|
|
|
98
94
|
return tracking_id
|
|
99
95
|
|
|
100
96
|
|
|
101
|
-
def check_url_alive(urls:
|
|
102
|
-
import requests
|
|
97
|
+
def check_url_alive(urls: List[str]) -> List[str]:
|
|
98
|
+
import requests # type: ignore
|
|
103
99
|
|
|
104
100
|
broken_urls = []
|
|
105
101
|
for url in urls:
|
|
@@ -116,10 +112,10 @@ def check_url_alive(urls: list) -> list:
|
|
|
116
112
|
|
|
117
113
|
|
|
118
114
|
# DEPRECATED
|
|
119
|
-
def get_urls_from_file(file_path: str) ->
|
|
115
|
+
def get_urls_from_file(file_path: str) -> List[str]:
|
|
120
116
|
"""function to get an array of urls from a file"""
|
|
121
117
|
urls = []
|
|
122
|
-
with open(file_path,
|
|
118
|
+
with open(file_path, encoding="utf-8") as file:
|
|
123
119
|
data = file.read()
|
|
124
120
|
url_pattern = re.compile(
|
|
125
121
|
r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9]{1,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)"
|
|
@@ -130,14 +126,12 @@ def get_urls_from_file(file_path: str) -> list:
|
|
|
130
126
|
return urls
|
|
131
127
|
|
|
132
128
|
|
|
133
|
-
def get_paths_from_file(file_path: str) ->
|
|
129
|
+
def get_paths_from_file(file_path: str) -> List[str]:
|
|
134
130
|
"""function to get relative paths from a file"""
|
|
135
131
|
paths = []
|
|
136
|
-
with open(file_path,
|
|
132
|
+
with open(file_path, encoding="utf-8") as file:
|
|
137
133
|
data = file.read()
|
|
138
|
-
path_pattern = re.compile(
|
|
139
|
-
r"(\.{1,2}\/)+([A-Za-z0-9-]+\/)*([A-Za-z0-9]+\.[A-Za-z]+)"
|
|
140
|
-
)
|
|
134
|
+
path_pattern = re.compile(r"(\.{1,2}\/)+([A-Za-z0-9-]+\/)*([A-Za-z0-9]+\.[A-Za-z]+)")
|
|
141
135
|
matches = re.finditer(path_pattern, data)
|
|
142
136
|
for matched_group in matches:
|
|
143
137
|
paths.append(matched_group.group())
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/paths/files_paths_reader.py
RENAMED
|
@@ -5,13 +5,14 @@ its subdirectories, filtered by file extension.
|
|
|
5
5
|
The main function in this module is `get_files_paths_list`.
|
|
6
6
|
|
|
7
7
|
Functions:
|
|
8
|
-
- get_files_paths_list(root_path: str, extension: list =
|
|
8
|
+
- get_files_paths_list(root_path: str, extension: list = []) -> list
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
import os
|
|
12
|
+
from typing import List, Tuple
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def get_files_paths_list(root_path: str, extensions:
|
|
15
|
+
def get_files_paths_list(root_path: str, extensions: List[str] = []) -> Tuple[List[str], List[str]]:
|
|
15
16
|
"""
|
|
16
17
|
function returns a list of files in a directory and its subdirectories,
|
|
17
18
|
filtered by file extensions.
|
|
@@ -24,10 +25,11 @@ def get_files_paths_list(root_path: str, extensions: list = None) -> list:
|
|
|
24
25
|
Returns:
|
|
25
26
|
list: A list of file paths that match the given file extensions.
|
|
26
27
|
"""
|
|
27
|
-
if extensions
|
|
28
|
+
if len(extensions) == 0:
|
|
28
29
|
extensions = [".md", ".ipynb"]
|
|
29
30
|
|
|
30
|
-
sub_folders
|
|
31
|
+
sub_folders: List[str] = []
|
|
32
|
+
files_paths: List[str] = []
|
|
31
33
|
|
|
32
34
|
for f in os.scandir(root_path):
|
|
33
35
|
if f.is_dir():
|
|
@@ -37,7 +39,7 @@ def get_files_paths_list(root_path: str, extensions: list = None) -> list:
|
|
|
37
39
|
files_paths.append(f.path)
|
|
38
40
|
|
|
39
41
|
for directory in list(sub_folders):
|
|
40
|
-
|
|
41
|
-
sub_folders.extend(
|
|
42
|
-
files_paths.extend(
|
|
42
|
+
sub_dir_sub_folders, sub_dir_file_paths = get_files_paths_list(directory, extensions)
|
|
43
|
+
sub_folders.extend(sub_dir_sub_folders)
|
|
44
|
+
files_paths.extend(sub_dir_file_paths)
|
|
43
45
|
return sub_folders, files_paths
|
|
File without changes
|
|
@@ -21,8 +21,8 @@ def main() -> None:
|
|
|
21
21
|
pass_list = [
|
|
22
22
|
"./CODE_OF_CONDUCT.md",
|
|
23
23
|
"./SECURITY.md",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
".\\CODE_OF_CONDUCT.md",
|
|
25
|
+
".\\SECURITY.md",
|
|
26
26
|
]
|
|
27
27
|
files_paths = [file_path for file_path in files_paths if file_path not in pass_list]
|
|
28
28
|
|
|
@@ -51,9 +51,7 @@ def main() -> None:
|
|
|
51
51
|
if broken_urls:
|
|
52
52
|
formatted_output += broken_urls
|
|
53
53
|
if formatted_output != "":
|
|
54
|
-
formatted_output =
|
|
55
|
-
"| File Full Path | Issues |\n|--------|--------|\n" + formatted_output
|
|
56
|
-
)
|
|
54
|
+
formatted_output = "| File Full Path | Issues |\n|--------|--------|\n" + formatted_output
|
|
57
55
|
print(formatted_output)
|
|
58
56
|
generate_md(formatted_output, in_arg.func, in_arg.guide_url)
|
|
59
57
|
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: markdown-checker
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A markdown link validation reporting tool
|
|
5
|
+
Author-email: John Aziz <johnaziz269@gmail.com>
|
|
6
|
+
Maintainer-email: John Aziz <johnaziz269@gmail.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2023 John Aziz
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/john0isaac/markdown-checker
|
|
30
|
+
Project-URL: Documentation, https://markdown-checker.readthedocs.io/en/latest/
|
|
31
|
+
Project-URL: Issues, https://github.com/john0isaac/markdown-checker/issues
|
|
32
|
+
Project-URL: Contributing, https://github.com/john0isaac/markdown-checker/pulls
|
|
33
|
+
Project-URL: Releases, https://github.com/john0isaac/markdown-checker/releases
|
|
34
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Requires-Python: >=3.8
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: requests
|
|
47
|
+
Requires-Dist: types-requests
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: pytest; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff; extra == "dev"
|
|
53
|
+
Requires-Dist: black; extra == "dev"
|
|
54
|
+
Requires-Dist: mypy; extra == "dev"
|
|
55
|
+
|
|
56
|
+
[](https://pypi.org/project/markdown-checker/)
|
|
57
|
+
[](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
|
|
58
|
+
[](https://pypi.org/project/markdown-checker/)
|
|
59
|
+
|
|
60
|
+
[](https://github.com/john0isaac/markdown-checker/issues)
|
|
61
|
+
[](https://github.com/john0isaac/markdown-checker/pulls)
|
|
62
|
+
|
|
63
|
+
markdown-checker is a markdown link validation reporting tool. It provides a couple of functions to validate relative paths and web URLs.
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
Install the package:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install markdown-checker
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Documentation
|
|
74
|
+
|
|
75
|
+
- [Full documentation](https://markdown-checker.readthedocs.io/en/latest/).
|
|
76
|
+
|
|
77
|
+
## 1, 2, 3 - How To
|
|
78
|
+
|
|
79
|
+
1. Run `pip install markdown-checker`.
|
|
80
|
+
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, `{func}` with the available functions like `check_broken_paths`, `{gu}` with your contribution guidance full URL.
|
|
81
|
+
3. The output will be displayed in the terminal and in a `comments.md` file.
|
|
82
|
+
|
|
83
|
+
## Using `markdown-checker` in GitHub Actions
|
|
84
|
+
|
|
85
|
+
You can run this tool within a GitHub workflow using the [action-check-markdown](https://github.com/marketplace/actions/check-markdown) GitHub action.
|
|
86
|
+
|
|
87
|
+
The action will automatically post the output of the tool to your GitHub pull request as a comment.
|
|
88
|
+
|
|
89
|
+
# Usage
|
|
90
|
+
|
|
91
|
+
The library provides the following functions:
|
|
92
|
+
|
|
93
|
+
- [Usage](#usage)
|
|
94
|
+
- [`check_broken_paths`](#check_broken_paths)
|
|
95
|
+
- [`check_broken_urls`](#check_broken_urls)
|
|
96
|
+
- [`check_urls_locale`](#check_urls_locale)
|
|
97
|
+
- [`check_paths_tracking`](#check_paths_tracking)
|
|
98
|
+
- [`check_urls_tracking`](#check_urls_tracking)
|
|
99
|
+
|
|
100
|
+
## `check_broken_paths`
|
|
101
|
+
|
|
102
|
+
This function ensures that any relative path in your files are working.
|
|
103
|
+
|
|
104
|
+
Example:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
markdown-checker -d . -f check_broken_paths -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## `check_broken_urls`
|
|
111
|
+
|
|
112
|
+
This function ensures that any web URL in your files is working and returning 200 status code.
|
|
113
|
+
|
|
114
|
+
Example:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
markdown-checker -d . -f check_broken_urls -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## `check_urls_locale`
|
|
121
|
+
|
|
122
|
+
This function checks if country specific locale is present in URLs.
|
|
123
|
+
|
|
124
|
+
Example:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
markdown-checker -d . -f check_urls_locale -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## `check_paths_tracking`
|
|
131
|
+
|
|
132
|
+
This function ensures that any relative path has tracking in it.
|
|
133
|
+
|
|
134
|
+
Example:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
markdown-checker -d . -f check_paths_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## `check_urls_tracking`
|
|
141
|
+
|
|
142
|
+
This function ensures that any URL has tracking in it.
|
|
143
|
+
|
|
144
|
+
Example:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
markdown-checker -d . -f check_urls_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
148
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/markdown_checker/__init__.py
|
|
5
|
+
src/markdown_checker/check_markdown.py
|
|
6
|
+
src/markdown_checker/py.typed
|
|
7
|
+
src/markdown_checker/validate_markdown.py
|
|
8
|
+
src/markdown_checker.egg-info/PKG-INFO
|
|
9
|
+
src/markdown_checker.egg-info/SOURCES.txt
|
|
10
|
+
src/markdown_checker.egg-info/dependency_links.txt
|
|
11
|
+
src/markdown_checker.egg-info/entry_points.txt
|
|
12
|
+
src/markdown_checker.egg-info/requires.txt
|
|
13
|
+
src/markdown_checker.egg-info/top_level.txt
|
|
14
|
+
src/markdown_checker/generators/__init__.py
|
|
15
|
+
src/markdown_checker/generators/md_generator.py
|
|
16
|
+
src/markdown_checker/inputs/__init__.py
|
|
17
|
+
src/markdown_checker/inputs/input_arguments.py
|
|
18
|
+
src/markdown_checker/links/__init__.py
|
|
19
|
+
src/markdown_checker/links/link_operations.py
|
|
20
|
+
src/markdown_checker/paths/__init__.py
|
|
21
|
+
src/markdown_checker/paths/files_paths_reader.py
|
|
22
|
+
tests/test_markdown_checker.py
|
|
@@ -5,7 +5,7 @@ Module to check paths in markdown files.
|
|
|
5
5
|
import subprocess
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def check_broken_paths():
|
|
8
|
+
def check_broken_paths() -> None:
|
|
9
9
|
"""
|
|
10
10
|
Function to check for broken paths.
|
|
11
11
|
"""
|
|
@@ -24,7 +24,7 @@ def check_broken_paths():
|
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
def check_broken_urls():
|
|
27
|
+
def check_broken_urls() -> None:
|
|
28
28
|
"""
|
|
29
29
|
Function to check for broken paths.
|
|
30
30
|
"""
|
|
@@ -43,7 +43,7 @@ def check_broken_urls():
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
def check_paths_tracking():
|
|
46
|
+
def check_paths_tracking() -> None:
|
|
47
47
|
"""
|
|
48
48
|
Function to check paths tracking.
|
|
49
49
|
"""
|
|
@@ -62,7 +62,7 @@ def check_paths_tracking():
|
|
|
62
62
|
)
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
def check_urls_tracking():
|
|
65
|
+
def check_urls_tracking() -> None:
|
|
66
66
|
"""
|
|
67
67
|
Function to check URLs tracking.
|
|
68
68
|
"""
|
|
@@ -81,7 +81,7 @@ def check_urls_tracking():
|
|
|
81
81
|
)
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
def check_urls_locale():
|
|
84
|
+
def check_urls_locale() -> None:
|
|
85
85
|
"""
|
|
86
86
|
Function to check URLs locale.
|
|
87
87
|
"""
|
|
@@ -113,12 +113,20 @@ try:
|
|
|
113
113
|
map(
|
|
114
114
|
int,
|
|
115
115
|
input(
|
|
116
|
-
"
|
|
116
|
+
"""
|
|
117
|
+
Do you want to:
|
|
118
|
+
(1) Run check_broken_paths
|
|
119
|
+
(2) Run check_broken_urls
|
|
120
|
+
(3) Run check_paths_tracking
|
|
121
|
+
(4) Run check_urls_tracking
|
|
122
|
+
(5) Run check_urls_locale
|
|
123
|
+
|
|
124
|
+
"""
|
|
117
125
|
).split(),
|
|
118
126
|
)
|
|
119
127
|
)
|
|
120
128
|
except ValueError:
|
|
121
|
-
print("Please input number")
|
|
129
|
+
print("Please input number.")
|
|
122
130
|
|
|
123
131
|
for choice in choices:
|
|
124
132
|
if 0 < choice and choice < 6:
|
markdown-checker-0.1.2/PKG-INFO
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: markdown-checker
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: A markdown validation reporting tool
|
|
5
|
-
Home-page: https://github.com/john0isaac/markdown-checker
|
|
6
|
-
Author: John Aziz
|
|
7
|
-
Author-email: johnaziz269@gmail.com
|
|
8
|
-
Maintainer: John Aziz
|
|
9
|
-
Maintainer-email: johnaziz269@gmail.com
|
|
10
|
-
License: MIT
|
|
11
|
-
Project-URL: Bug Tracker, https://github.com/john0isaac/markdown-checker/issues
|
|
12
|
-
Project-URL: Contributing, https://github.com/john0isaac/markdown-checker/pulls
|
|
13
|
-
Project-URL: Source Code, https://github.com/john0isaac/markdown-checker
|
|
14
|
-
Project-URL: Releases, https://github.com/john0isaac/markdown-checker/releases
|
|
15
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
-
Requires-Python: >=3.8
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: requests
|
|
24
|
-
|
|
25
|
-
[](https://pypi.org/project/markdown-checker/)
|
|
26
|
-
[](https://pypi.org/project/markdown-checker/)
|
|
27
|
-
|
|
28
|
-
[](https://github.com/john0isaac/markdown-checker/issues)
|
|
29
|
-
[](https://github.com/john0isaac/markdown-checker/pulls)
|
|
30
|
-
|
|
31
|
-
markdown-checker is a markdown validation reporting tool.
|
|
32
|
-
|
|
33
|
-
# How To
|
|
34
|
-
|
|
35
|
-
1. Run `pip install markdown-checker`.
|
|
36
|
-
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, {func} with the available functions like check_broken_paths, {gu} with your contribution guidance full URL.
|
|
37
|
-
3. The output will be displayed in the terminal and in a `comments.md` file.
|
|
38
|
-
|
|
39
|
-
# Using markdown-checker in GitHub Actions
|
|
40
|
-
|
|
41
|
-
The tool has been designed to be run within a GitHub workflow using the [action-check-markdown](https://github.com/marketplace/actions/check-markdown) GitHub action. The action will automatically post the output of the tool to your GitHub pull request as a comment.
|
|
42
|
-
|
|
43
|
-
# Supported Functions
|
|
44
|
-
|
|
45
|
-
## Check broken relative paths
|
|
46
|
-
This function ensures that any relative path in your files is working.
|
|
47
|
-
|
|
48
|
-
Example:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
markdown-checker -d . -f check_broken_paths -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Check broken URLs
|
|
55
|
-
This function ensures that any web URL in your files is working and returning 200 status code.
|
|
56
|
-
|
|
57
|
-
Example:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
markdown-checker -d . -f check_broken_urls -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Check country locale present in URLs
|
|
64
|
-
This function ensures that any relative path in your files is working.
|
|
65
|
-
|
|
66
|
-
Example:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
markdown-checker -d . -f check_urls_locale -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Check Contributor ID missing from paths
|
|
73
|
-
This function ensures that any relative path has tracking in it.
|
|
74
|
-
|
|
75
|
-
Example:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
markdown-checker -d . -f check_paths_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Check Contributor ID missing from URLs
|
|
82
|
-
This function ensures that any URL has tracking in it.
|
|
83
|
-
|
|
84
|
-
Example:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
markdown-checker -d . -f check_urls_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
88
|
-
```
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: markdown-checker
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: A markdown validation reporting tool
|
|
5
|
-
Home-page: https://github.com/john0isaac/markdown-checker
|
|
6
|
-
Author: John Aziz
|
|
7
|
-
Author-email: johnaziz269@gmail.com
|
|
8
|
-
Maintainer: John Aziz
|
|
9
|
-
Maintainer-email: johnaziz269@gmail.com
|
|
10
|
-
License: MIT
|
|
11
|
-
Project-URL: Bug Tracker, https://github.com/john0isaac/markdown-checker/issues
|
|
12
|
-
Project-URL: Contributing, https://github.com/john0isaac/markdown-checker/pulls
|
|
13
|
-
Project-URL: Source Code, https://github.com/john0isaac/markdown-checker
|
|
14
|
-
Project-URL: Releases, https://github.com/john0isaac/markdown-checker/releases
|
|
15
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
-
Requires-Python: >=3.8
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: requests
|
|
24
|
-
|
|
25
|
-
[](https://pypi.org/project/markdown-checker/)
|
|
26
|
-
[](https://pypi.org/project/markdown-checker/)
|
|
27
|
-
|
|
28
|
-
[](https://github.com/john0isaac/markdown-checker/issues)
|
|
29
|
-
[](https://github.com/john0isaac/markdown-checker/pulls)
|
|
30
|
-
|
|
31
|
-
markdown-checker is a markdown validation reporting tool.
|
|
32
|
-
|
|
33
|
-
# How To
|
|
34
|
-
|
|
35
|
-
1. Run `pip install markdown-checker`.
|
|
36
|
-
2. Run `markdown-checker -d {src} -f {func} -gu {url}`. Replace `{src}` with the directory you want to analyze, {func} with the available functions like check_broken_paths, {gu} with your contribution guidance full URL.
|
|
37
|
-
3. The output will be displayed in the terminal and in a `comments.md` file.
|
|
38
|
-
|
|
39
|
-
# Using markdown-checker in GitHub Actions
|
|
40
|
-
|
|
41
|
-
The tool has been designed to be run within a GitHub workflow using the [action-check-markdown](https://github.com/marketplace/actions/check-markdown) GitHub action. The action will automatically post the output of the tool to your GitHub pull request as a comment.
|
|
42
|
-
|
|
43
|
-
# Supported Functions
|
|
44
|
-
|
|
45
|
-
## Check broken relative paths
|
|
46
|
-
This function ensures that any relative path in your files is working.
|
|
47
|
-
|
|
48
|
-
Example:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
markdown-checker -d . -f check_broken_paths -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Check broken URLs
|
|
55
|
-
This function ensures that any web URL in your files is working and returning 200 status code.
|
|
56
|
-
|
|
57
|
-
Example:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
markdown-checker -d . -f check_broken_urls -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Check country locale present in URLs
|
|
64
|
-
This function ensures that any relative path in your files is working.
|
|
65
|
-
|
|
66
|
-
Example:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
markdown-checker -d . -f check_urls_locale -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Check Contributor ID missing from paths
|
|
73
|
-
This function ensures that any relative path has tracking in it.
|
|
74
|
-
|
|
75
|
-
Example:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
markdown-checker -d . -f check_paths_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Check Contributor ID missing from URLs
|
|
82
|
-
This function ensures that any URL has tracking in it.
|
|
83
|
-
|
|
84
|
-
Example:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
markdown-checker -d . -f check_urls_tracking -gu https://github.com/john0isaac/markdown-checker/blob/main/CONTRIBUTING.md
|
|
88
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
MANIFEST.in
|
|
3
|
-
README.md
|
|
4
|
-
pyproject.toml
|
|
5
|
-
setup.cfg
|
|
6
|
-
setup.py
|
|
7
|
-
markdown_checker/__init__.py
|
|
8
|
-
markdown_checker/check_markdown.py
|
|
9
|
-
markdown_checker/validate_markdown.py
|
|
10
|
-
markdown_checker.egg-info/PKG-INFO
|
|
11
|
-
markdown_checker.egg-info/SOURCES.txt
|
|
12
|
-
markdown_checker.egg-info/dependency_links.txt
|
|
13
|
-
markdown_checker.egg-info/entry_points.txt
|
|
14
|
-
markdown_checker.egg-info/requires.txt
|
|
15
|
-
markdown_checker.egg-info/top_level.txt
|
|
16
|
-
markdown_checker/generators/__init__.py
|
|
17
|
-
markdown_checker/generators/md_generator.py
|
|
18
|
-
markdown_checker/inputs/__init__.py
|
|
19
|
-
markdown_checker/inputs/input_arguments.py
|
|
20
|
-
markdown_checker/links/__init__.py
|
|
21
|
-
markdown_checker/links/link_operations.py
|
|
22
|
-
markdown_checker/paths/__init__.py
|
|
23
|
-
markdown_checker/paths/files_paths_reader.py
|
|
24
|
-
tests/test_markdown_checker.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
requests
|
markdown-checker-0.1.2/setup.cfg
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = markdown-checker
|
|
3
|
-
version = 0.1.2
|
|
4
|
-
author = John Aziz
|
|
5
|
-
author_email = johnaziz269@gmail.com
|
|
6
|
-
maintainer = John Aziz
|
|
7
|
-
maintainer_email = johnaziz269@gmail.com
|
|
8
|
-
description = A markdown validation reporting tool
|
|
9
|
-
long_description = file: README.md
|
|
10
|
-
long_description_content_type = text/markdown
|
|
11
|
-
license = MIT
|
|
12
|
-
url = https://github.com/john0isaac/markdown-checker
|
|
13
|
-
requires_python = ">=3.8"
|
|
14
|
-
project_urls =
|
|
15
|
-
Bug Tracker = https://github.com/john0isaac/markdown-checker/issues
|
|
16
|
-
Contributing = https://github.com/john0isaac/markdown-checker/pulls
|
|
17
|
-
Source Code = https://github.com/john0isaac/markdown-checker
|
|
18
|
-
Releases = https://github.com/john0isaac/markdown-checker/releases
|
|
19
|
-
classifiers =
|
|
20
|
-
Development Status :: 5 - Production/Stable
|
|
21
|
-
License :: OSI Approved :: MIT License
|
|
22
|
-
Operating System :: OS Independent
|
|
23
|
-
Programming Language :: Python :: 3
|
|
24
|
-
Programming Language :: Python :: 3.8
|
|
25
|
-
|
|
26
|
-
[options]
|
|
27
|
-
install_requires =
|
|
28
|
-
requests
|
|
29
|
-
include_package_data = True
|
|
30
|
-
packages = find:
|
|
31
|
-
python_requires = >=3.8
|
|
32
|
-
|
|
33
|
-
[options.entry_points]
|
|
34
|
-
console_scripts =
|
|
35
|
-
markdown-checker = markdown_checker.validate_markdown:main
|
|
36
|
-
|
|
37
|
-
[egg_info]
|
|
38
|
-
tag_build =
|
|
39
|
-
tag_date = 0
|
|
40
|
-
|
markdown-checker-0.1.2/setup.py
DELETED
|
File without changes
|
|
File without changes
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker/generators/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{markdown-checker-0.1.2 → markdown_checker-0.1.4/src}/markdown_checker.egg-info/top_level.txt
RENAMED
|
File without changes
|