diff --git a/CHANGELOG.md b/CHANGELOG.md index fff0dd8..ef21df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,16 @@ All notable changes to this project will be documented in this file. ### Other Changes +## [v0.2.2] 8 Nov 2024 + +- Change Broken URLs flagging to always try head and get request on any URL before flagging it as broken. + ## [v0.2.1] 7 Aug 2024 + - Fix command line list[str] type issue and use Click.IntRange for retries and timeout. ## [v0.2.0] 7 Aug 2024 + - Redesign the package. - Port to using Click instead of arg_parser. - Expose options for external users to allow for more customization. @@ -30,9 +36,11 @@ All notable changes to this project will be documented in this file. - Add support for GitHub automatic annotations. ## [v0.1.5] 8 Jul 2024 + - Increase timeout for requests to check web urls alive or not. https://github.com/john0isaac/markdown-checker/pull/52 ## [v0.1.4] 6 May 2024 + - Improve Dev Experience. https://github.com/john0isaac/markdown-checker/pull/28 - Better Typing. https://github.com/john0isaac/markdown-checker/pull/37 - Add ruff, black, mypy and workflows to check them on all supported python versions. @@ -41,23 +49,27 @@ All notable changes to this project will be documented in this file. - Add docs in read the docs https://markdown-checker.readthedocs.io/en/latest/ ## [v0.1.3] 15 March 2024 -* Change lessons to files -* Remove ID's from the end of Relative Paths + +- Change lessons to files +- Remove ID's from the end of Relative Paths ## [v0.1.2] 06 March 2024 -* Improve-package by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/21 -* Skipped vs code redirect urls -* fixed typos + +- Improve-package by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/21 +- Skipped vs code redirect urls +- fixed typos ## [v0.1.1] 06 March 2024 -* fix: add requests to required packages by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/19 + +- fix: add requests to required packages by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/19 ## [v0.1.0] 06 March 2024 -* add development requirements and install in devcontainer by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/13 -* format with ruff and black by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/14 -* improve output of checker by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/15 -* feat: broken urls by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/16 -* Skip microsoft security blog by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/17 + +- add development requirements and install in devcontainer by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/13 +- format with ruff and black by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/14 +- improve output of checker by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/15 +- feat: broken urls by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/16 +- Skip microsoft security blog by @john0isaac in https://github.com/john0isaac/markdown-checker/pull/17 ## [v0.0.9] 05 March 2024 @@ -71,7 +83,6 @@ All notable changes to this project will be documented in this file. - define tests to execute functions - docs: add instructions for local development - ## [v0.0.7] 26 November 2023 - Rename get_input_args to inputs module with no change. diff --git a/pyproject.toml b/pyproject.toml index c76bf16..d518f0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "markdown-checker" description= "A markdown link validation reporting tool." -version = "0.2.1" +version = "0.2.2" authors = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }] maintainers = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }] license = {file = "LICENSE"} diff --git a/src/markdown_checker/urls.py b/src/markdown_checker/urls.py index 17bc89f..26cce4e 100644 --- a/src/markdown_checker/urls.py +++ b/src/markdown_checker/urls.py @@ -43,9 +43,10 @@ def is_alive(self, timeout: int = 10, retries: int = 3) -> bool: response = requests.head(self.link, timeout=timeout, allow_redirects=True) if response.status_code == 200: return True - elif response.status_code == 405: + else: response = requests.get(self.link, timeout=timeout, allow_redirects=True) - return response.status_code == 200 + if response.status_code == 200: + return True except requests.RequestException: continue time.sleep(1)