Skip to content

Latest commit

Β 

History

History
30 lines (21 loc) Β· 1.12 KB

File metadata and controls

30 lines (21 loc) Β· 1.12 KB

Contributing to pr-guardian

Thanks for wanting to help! Here's the deal:

Rules

  • No build step β€” pure Python stdlib only. No pip install, no npm, no compilation.
  • Keep it simple β€” the scanner is one file (scripts/scan.py). The rules live at the top. Add a pattern, add a test case, done.
  • No false positive arms race β€” if a rule is too noisy, it's worse than no rule. Test on real repos before shipping.

Adding a rule

  1. Open scripts/scan.py and find the RULES list at the top.
  2. Add a new dict with:
    • id: short unique identifier (e.g. "azure-key")
    • pattern: regex that matches the bad thing
    • sev: "high", "medium", "low", or "info"
    • msg: human-readable description of what was found
  3. Run python3 scripts/scan.py on a repo that uses the thing you're detecting to verify it works and doesn't false-positive on everything.

Testing locally

python3 scripts/scan.py /path/to/your/repo
python3 scripts/scan.py https://github.com/owner/repo/pull/123

PRs

Open one. Describe what you changed and why. If you added a rule, show it catching something real.