Skip to content

Conversation

@patelscripts
Copy link

This pull request refactors the check-broken-links-md.py script to improve its reliability, maintainability, and clarity. The previous implementation had issues with fragile parsing, incorrect whitelist handling, and unsafe process termination. This update restructures the script into smaller, testable components and adds several enhancements to make it more robust and user-friendly.

Key improvements include:

1: Fixed whitelist logic so URLs in the exception list are properly ignored.

2: Replaced os._exit(1) with sys.exit(1) for safer termination and cleanup.

3: Implemented regex-based parsing to accurately extract files, URLs, and status codes.

4: Cleaned up subprocess handling to correctly capture both stdout and stderr.

@patelscripts
Copy link
Author

“Hi @xmnlab, I’ve refactored the link checker and tested locally. Please review and approve when possible ”

@xmnlab
Copy link
Member

xmnlab commented Nov 12, 2025

@patelscripts , thanks for working on that.

general recommendations for your PRs:

  • don't change too much the current structure of the code, instead if you have a strong argument for that, otherwise it makes the review harder.
  • don't add unnecessary comments in the code, usually that is a red flag for code generated by AI
  • keep your change as smaller as possible, just focus on the key parts, changing current docstrings, removing __future__ import, renaming functions, etc is a red flag for code generated by AI.
  • ensure all tests passes on CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants