simonw / simonw/tools

Hashes in gathered links may contain leading newlines

Open
#172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.9k
Forks
191
Avg merge
36m
Merged PRs (30d)
12

Description

Hey Simon, all but the first hash per tool has a leading newline here:

https://github.com/simonw/tools/blob/8152f0b79eeb0007bde3e299f954e3343cc2d14d/gather_links.py#L38

The colophon page thus ends up having the HTML “broken” in the commit hash URLs because of the leading newlines, although browsers don't seem to be fazed by it. I did have an issue with these newlines in the middle of URLs, though, and ended up fixing it with a plain call to .strip():

commit_hash = raw_commit[:first_pipe].strip()

Thought you might like to know since these extra newlines might bite you later down the road.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in gather_links.py at line 38, where raw_commit is used to obtain the commit hash. Reproduce the generated colophon links and inspect whether hashes contain leading newlines, then verify that the resulting commit-hash URLs contain no leading or embedded newline characters.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.