committed icon indicating copy to clipboard operation
committed copied to clipboard

RFE: check allowed authors

Open scop opened this issue 1 year ago • 3 comments

A check for allowed authors would be nice, for example so that projects wanting committers to use their project/organization related e-mail addresses for commits could check that.

I think a regex config option and related (inverse) matching similar to ignore_author_re could be used for this.

scop avatar Nov 16 '23 17:11 scop

Mind writing up a proposed schema with an example of what data it would allow/disallow and what that message would look like?

epage avatar Nov 16 '23 17:11 epage

Mini-PR in https://github.com/crate-ci/committed/pull/354 -- feel free to reuse that and the associated branch for the implementation if you're taking this on.

  • The regex would be matched against the commit author (whole string), just like ignore_author_re.
  • If the regex matches, all good, no messages.
  • If it does not match, would cause an error with a message like
    Commit author `{}` does not match allowed regular expression `{}`
    

scop avatar Nov 19 '23 12:11 scop

Seems reasonable if someone wants to implement it.

epage avatar Nov 27 '23 19:11 epage