-
Notifications
You must be signed in to change notification settings - Fork 26.4k
chore(commit message): use commitplease to validate commit messages #9953
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
Conversation
I often commit tmp commits during dev, would it be possible to
|
For temporary commits, you could either begin the commit message with:
or you could do |
@@ -115,5 +116,8 @@ | |||
"webpack": "^1.12.6", | |||
"which": "~1", | |||
"yargs": "^3.31.0" | |||
}, | |||
"commitplease": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we include types as well?
https://www.npmjs.com/package/commitplease#angularjs
they are listed here:
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, those types are actually default values inside commitplease (once you choose angular style) and so can be left out
But you could redefine them in package.json
if needed, as shown in your first link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually use WIP at the beginning of a tmp commit message, so this seems
like a good idea to me. Any objection @vicb ?
On Mon, Jul 25, 2016 at 11:17 PM Alexander Lisianoi <
notifications@github.com> wrote:
In package.json
#9953 (comment):@@ -115,5 +116,8 @@
"webpack": "^1.12.6",
"which": "~1",
"yargs": "^3.31.0"
- },
- "commitplease": {
no, those types are actually default values inside commitplease and can be
left outBut you could redefine them in package.json if needed, as shown in the
your link—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular/pull/9953/files/7b6721838c8a96fedeabc08b5be7c931e19f459f#r72192975,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAC5I-aDiQk4z01m-oEbhPbkAa95hB7gks5qZaZ0gaJpZM4JJT0y
.
Can we use "f!" fixup is too long ? I'm 👎 to merge this before:
I think it would be a really bad dev XP to have a cryptic error message on commits. (Not that I know the current one but that's related to my previous point) |
@all3fox sorry for the delay in processing. I would be interested in merging this PR. Is there a way to test the commits message on the CI ? (fails if the commit message do not follow our conventions) Thanks |
Hello @vicb Currently, commitplease checks its
So, for instance you could have a shell script that creates a git repository, installs commitlpease there, configures it however you like via Finally, on our Travis CI we use this test.js script that basically creates a bunch of So, what I am saying is you could take the main test function from line 802 and then roll your own Travis CI test script with Tell me what you would prefer and I may help with that. |
You should also be able to call the commitplease executable in a local install on Travis as described here: https://github.com/jzaefferer/commitplease/blob/master/README.md#global-install |
This patch adds the gulp command of `validate-commit-messages` which will validate the range of commits messages present in the active branch. This check now runs on CI as part of the linting checks. Allowed commit message types and scopes are controlled via commit-message.json file and documented at https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines This solution is based on old Vojta's code that he wrote for angular/angular.js, that was later adjusted by @matsko in angular#13815. Ideally we should switch over to something like https://www.npmjs.com/package/commitplease as suggested in angular#9953 but that package currently doesn't support strict scope checking, which is one of the primarily goal of this PR. Note that this PR removes support for "chore" which was previously overused by everyone on the team. Closes angular#13815 Fixes angular#3337
This patch adds the gulp command of `validate-commit-messages` which will validate the range of commits messages present in the active branch. This check now runs on CI as part of the linting checks. Allowed commit message types and scopes are controlled via commit-message.json file and documented at https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines This solution is based on old Vojta's code that he wrote for angular/angular.js, that was later adjusted by @matsko in #13815. Ideally we should switch over to something like https://www.npmjs.com/package/commitplease as suggested in #9953 but that package currently doesn't support strict scope checking, which is one of the primarily goal of this PR. Note that this PR removes support for "chore" which was previously overused by everyone on the team. Closes #13815 Fixes #3337
Closing as outdated, please sync and re-open if needed. |
This patch adds the gulp command of `validate-commit-messages` which will validate the range of commits messages present in the active branch. This check now runs on CI as part of the linting checks. Allowed commit message types and scopes are controlled via commit-message.json file and documented at https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines This solution is based on old Vojta's code that he wrote for angular/angular.js, that was later adjusted by @matsko in angular#13815. Ideally we should switch over to something like https://www.npmjs.com/package/commitplease as suggested in angular#9953 but that package currently doesn't support strict scope checking, which is one of the primarily goal of this PR. Note that this PR removes support for "chore" which was previously overused by everyone on the team. Closes angular#13815 Fixes angular#3337
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
Tests for the changes have been added (for bug fixes / features)Docs have been added / updated (for bug fixes / features)What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Developers follow commit message style best they can
What is the new behavior?
An external npm module that checks commit messages for you
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
commitplease is an npm module that installs a git hook during
npm install
and checks that your commit message follows the style guide when you dogit commit
. If the message does not follow the style guide, the commit is aborted and an exact diagnostic is printed so that the developer can correct the commit message.How to try out:
Now try to commit some changes with valid/invalid commit messages.
How to go back:
Disclaimer: I am contributing to commitplease as part of the Google Summer of Code project for students.
There is also a twin pull request to angular/angular.js#14888