Description:
Large pull requests are harder to review thoroughly and more likely to introduce undetected bugs, yet TariffShield has no guardrail to discourage oversized changes. A PR size checker that warns when a diff exceeds 400 lines and fails CI when it exceeds 1000 lines nudges contributors to split work into reviewable chunks, improving review quality and reducing merge risk.
Acceptance Criteria:
Relevant Files:
.github/workflows/pr-size.yml — new PR size check workflow
.prsize-ignore — glob patterns for files excluded from line count
CONTRIBUTING.md — contributor guide (add PR size policy section)
Description:
Large pull requests are harder to review thoroughly and more likely to introduce undetected bugs, yet TariffShield has no guardrail to discourage oversized changes. A PR size checker that warns when a diff exceeds 400 lines and fails CI when it exceeds 1000 lines nudges contributors to split work into reviewable chunks, improving review quality and reducing merge risk.
Acceptance Criteria:
.github/workflows/pr-size.ymlthat triggers onpull_request(types:opened,synchronize,reopened) and counts the total lines added plus removed usinggit diff --statagainst the PR base SHAactions/github-scriptwarning "This PR is large (N lines). Consider splitting it into smaller PRs for easier review." and set the step outcome toneutral(do not fail)package-lock.json,Cargo.lock,*.snaptest snapshots, and any file underdist/ortarget/are excluded via a.prsize-ignorefile at the repo root using the same glob format as.gitignoreenvvariablesPR_SIZE_WARNandPR_SIZE_FAILso they can be adjusted without editing workflow logiclarge-pr-approvedlabel applied by a maintainer, the size check is bypassed — allowing emergency large changes with explicit sign-offCONTRIBUTING.mdunder "Pull Request Guidelines" with guidance on how to split a large feature into smaller PRsRelevant Files:
.github/workflows/pr-size.yml— new PR size check workflow.prsize-ignore— glob patterns for files excluded from line countCONTRIBUTING.md— contributor guide (add PR size policy section)