Skip to content

feat(enrichment): commit-message conventional-commit lint analyzer #2021

Description

@JSONbored

New REES github-light analyzer that lints the PR's commit subjects against the Conventional Commits spec (type(scope): summary, ≤ ~72 chars, allowed types) and reports non-conforming subjects — a house-rule the gate cares about, surfaced early to the reviewer. Uses the GitHub commits API with bounded fanout; fail-safe when the token is absent.

Deliverables

  • Add CommitLintFinding ({ sha: string, subject: string, reason: 'bad-type'|'missing-colon'|'too-long'|'empty' }) + commitLint? key to review-enrichment/src/types.ts (sha prefix only, no author/email)
  • Create review-enrichment/src/analyzers/commit-lint.ts: fetch PR commits via GitHub API through the shared bounded fetch layer (inject fetch for tests), lint each subject, cap lookups + findings
  • Register a descriptor (category 'quality', cost 'github-light', requires ['github-token']) in review-enrichment/src/analyzers/registry.ts with inline render()
  • Add review-enrichment/test/commit-lint.test.ts covering conforming vs each non-conforming reason, the lookup cap, and the token-absent skip/degrade path

References

  • review-enrichment/src/analyzers/commit-signature.ts (github-light commits-API analyzer with injected fetch + bounded fanout)
  • review-enrichment/src/external-fetch.ts (shared bounded fetch layer required by the epic)
  • review-enrichment/src/analyzers/registry.ts:283-302 (commitSignature descriptor template)

Part of #1499.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions