check_external_links.py main() assigns a module global for the retry delay

Open Beginner friendly
#1,287 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Start with scripts/check_external_links.py, reading main, _open, and the run and check_url call paths. Trace how --retry-delay reaches the retry logic, then run the existing tests for this script. Done means calling main(['--retry-delay', '7']) leaves RETRY_DELAY unchanged and the tests no longer need to monkeypatch it.

Written by the indexing model from the issue text.

Description

enhancement good first issue tooling

Where: scripts/check_external_links.py (main, _open).

Current gap: --retry-delay is applied by assigning the module-level RETRY_DELAY inside main (with a global statement), so one in-process call changes the delay for every later call and the tests have to restore it by hand.

Suggested approach: Pass the delay down through run and check_url as a parameter with the constant as its default, and drop the global.

Done when: calling main(['--retry-delay', '7']) leaves RETRY_DELAY unchanged and the existing tests need no monkeypatch of it.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
2h 45m
Merged PRs (30d)
93

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.