Skip to content

fix(submit): make the README and community checks say what's missing - #206

Merged
jamesconwaydev merged 1 commit into
devstreamhq:mainfrom
foothillsdigital:fix/readme-community-checks
Nov 6, 2026
Merged

jamesconwaydev merged 1 commit into
devstreamhq:mainfrom
foothillsdigital:fix/readme-community-checks

Conversation

@foothillsdigital

Copy link
Copy Markdown
Collaborator

What and why

Closes #49.

  • "Add at least two" when you have one. _extras_missing only returns a list when every check ran, so found = 7 − missing. With one already there, the message is now "Add one more of these to the repo: …".
  • #hashtag lines. The heading strip matched any line starting with #. It now needs #–###### followed by a space or tab, or nothing (CommonMark's ATX rule), so #rustlang #cli … counts as prose.
  • Setext headings. A non-blank line underlined with === or --- is now stripped like an ATX heading. Using a lookahead, it scans each line once. My first version, [^\n]*\S[^\n]*, backtracked on long lines, and the existing ReDoS and large-README tests caught it.
  • Missing community profile. It 404s for every fork (I checked on a fork of this repo), so raising there would park every diverged fork. A 404 now falls back to listing the root, .github and docs (one call each, only on the 404 path). Files named contributing.*, code_of_conduct.*, issue_template[.*] or pull_request_template[.*] count, case-insensitively, and a directory counts too (e.g. .github/ISSUE_TEMPLATE/). A missing folder just adds nothing.
  • Undecodable README. file_bytes decoded with validate=False, which silently drops invalid characters, so !!!! came out empty and read as a short README. It's now validate=True (whitespace is still stripped first), so that raises Undecided. This is shared with the licence-file reads, which get the same treatment.

Each case has a test, and all four test changes fail on main.

Checks

  • The PR title follows Conventional Commits
  • python3 -m unittest discover -s scripts -t . passes (571, ~2.5s)
  • npm --prefix site test passes (if you touched site/)
  • npx prettier --check . passes
  • This doesn't edit data/entries.json by hand (submissions go through the form)

- The extras message says "Add one more" when one is already there,
  instead of "Add at least two".
- A #hashtag line is prose now; only # to ###### followed by a space
  (or nothing) is an ATX heading. Setext headings (a line underlined
  with === or ---) are stripped too.
- Forks have no community profile (404), so the CONTRIBUTING, code of
  conduct and template checks now list the root, .github and docs
  folders instead of reading a 404 as "nothing there".
- README and licence content is base64-decoded with validate=True, so
  stray characters make the read undecided instead of decoding to a
  short README.

@jamesconwaydev jamesconwaydev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work, especially the fork fallback. Raising on that 404 would have parked every diverged fork. Good instinct on the setext regex too, and I'm glad the ReDoS test caught the first version. Approved; I'll merge once CI is green.

@jamesconwaydev
jamesconwaydev merged commit c89e4d4 into devstreamhq:main Nov 6, 2026
9 checks passed
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.

Sharpen the README and community checks

2 participants