Skip to content

check-scope flags PRs that follow the CONTRIBUTING checklist (code + tests + changeset) #595

Description

@rhiannalitchfield

Summary

The check-scope job flags PRs that follow the CONTRIBUTING checklist. A PR that ships code with tests and a changeset (both required for user-visible changes) always counts as 3+ areas and fails the check. Observed on #594, which contains only the mandated trio: two source files, their two test files, and one changeset.

There are two layers to this:

1. .changeset/* is misclassified as docs. In .github/scripts/classify-pr-files.sh, the chore patterns include .changeset/*, but the case statement evaluates in order and the docs pattern *.md comes first. Since changesets are all .md files, they always land in docs and the intended .changeset/* match is unreachable.

2. Even with that fixed, compliant PRs still trip the check. CONTRIBUTING requires code changes to ship with tests, and user-visible changes to ship with a changeset, so a compliant PR always touches code + test + changeset. That counts as 3 areas (code, test, chore) and fails. Splitting along those lines would produce a code PR with no tests, which the same guidelines forbid.

Proposal

Treat test files (*_test.go and the other test patterns) and .changeset/* as coupled to code rather than as separate areas, e.g. exclude them from the category count the way other already is, or only count them when no code files are present. The check would still catch genuinely mixed PRs (say, CI changes bundled with feature work) without flagging compliant ones. Reordering the case patterns so .changeset/* matches before *.md is worth doing regardless.

Acceptance criteria

  • A PR containing only source files, their tests, and a changeset passes check-scope.
  • Changeset files are classified as chore (or excluded), not docs.
  • A PR mixing unrelated areas (e.g. workflows + source code + docs) still fails.

Happy to pick this up. Context: first noticed in #594 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions