Why this matters
LGPD requires lawful basis and impact assessment for higher-risk processing; catching at review time prevents non-compliant changes.
When a PR introduces new PII fields or processing, the PR body must include legal_basis: (e.g., consent, contract) and dpia: (yes/no with link). CI should fail if missing.
LGPD requires lawful basis and impact assessment for higher-risk processing; catching at review time prevents non-compliant changes.
Side-by-side examples engineers can pattern-match during review.
// detectNewPII(['cpf','birth_date']) -> true\nconst body = process.env.PR_BODY || '';\nif(!/legal_basis:/i.test(body)) process.exit(0);const hasPII = detectNewPII(changedFiles());\nconst body = process.env.PR_BODY || '';\nif(hasPII && (!/legal_basis:\s\w+/i.test(body) || !/dpia:\s*(yes|no)/i.test(body))){\n console.error('Missing LGPD metadata');\n process.exit(1);\n}\nprocess.exit(0);legal_basis: consent\ndpia: yes\ndpia_link: https://…This PR adds cpf columnFrom the same buckets as this rule.