Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit message check does not enforce "fixes"/"refs" in parentheses #56

Closed
platinumazure opened this issue Jan 20, 2018 · 4 comments · Fixed by #70
Closed

Commit message check does not enforce "fixes"/"refs" in parentheses #56

platinumazure opened this issue Jan 20, 2018 · 4 comments · Fixed by #70

Comments

@platinumazure
Copy link
Member

Since we no longer enforce that commits end with "fixes [issue]" or "refs [issue]", we are now allowing commit messages which do mention an issue, but not the way we would like. (See eslint/eslint#9745 for an example.)

Would it be possible to flag commit messages that do contain "fixes [issue]" or "refs [issue]", but not formatted the way we like (i.e., in parentheses at the end of the commit summary)? Is this something we should consider doing?

@platinumazure
Copy link
Member Author

Friendly ping to @eslint/eslint-team for thoughts on this one.

@nzakas
Copy link
Member

nzakas commented Jan 28, 2018

I think we should definitely do this. The more early feedback we can give to people, the better.

@kaicataldo
Copy link
Member

Agreed! And better to automate it when we can - saves everyone time and energy.

@platinumazure
Copy link
Member Author

platinumazure commented May 22, 2018

Apologies, I've left this sitting for a while. I'm hoping to work on this in the next few weeks-- if someone else wants to work on this, just leave a comment and I'll happily leave it to you.

Here's my rough implementation idea:

  • All changes go in the commit-message plugin
  • First, run the commit summary through a regex looking for something like #\d+
  • If found, then check that message ends with (fixes #1111) or (refs #1111)
    • Or, for multiple issues: (fixes #1111, refs #2222, fixes #3333) (basically allow list of fixes/refs issue number)
  • If issue number was detected but commit message does not end properly, fail the commit-message check. Add info to the commit guidelines web page (linked in the status check).

If anyone has any feedback on this, feel free to share. Otherwise, that's what I'll attempt to do once I start working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants