DEV Community

Olivier Buitelaar
Olivier Buitelaar

Posted on

Your PRs Are Too Big (And This GitHub Action Will Tell You)

Research consistently shows that code review quality drops after 200-400 lines of changes. Large PRs get rubber-stamped. Small PRs get thoughtful feedback.

But nobody wants to create large PRs. It just... happens. And without visibility, nobody notices until the review is painful.

Make PR Size Visible

I just shipped pr-size-labeler — a GitHub Action that automatically labels every PR by its diff size.

- uses: ollieb89/pr-size-labeler@v1
Enter fullscreen mode Exit fullscreen mode

One line. Every PR gets a label:

Label Lines Changed Signal
size/XS 0-10 Trivial — review in 2 minutes
size/S 11-50 Quick — grab a coffee and review
size/M 51-200 Moderate — block 15 minutes
size/L 201-500 Large — schedule dedicated time
size/XL 501+ Consider splitting this PR

Smart Exclusions

The clever bit: lock files and generated code are excluded by default. A 5-line dependency bump shouldn't get an XL label because package-lock.json added 2000 lines.

Default exclusions:

  • package-lock.json, yarn.lock, pnpm-lock.yaml
  • *.generated.*
  • dist/**

Customize with:

- uses: ollieb89/pr-size-labeler@v1
  with:
    exclude-patterns: |
      **/*.snap
      docs/generated/**
Enter fullscreen mode Exit fullscreen mode

The Toolkit

This is the third action in a growing toolkit:

  1. workflow-guardian — catches workflow security issues
  2. test-results-reporter — aggregates test results into PR comments
  3. pr-size-labeler — labels PRs by size

All free. All open source. All zero-config.


Building developer tools in public. Follow for more, or check the repos.

Top comments (0)