-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: add commitlint command #190
Conversation
@hacdias have you tested this with aegir-test-repo? |
No, but I will. That's not the problem though. I'm having an issue with commitlint itself but that's probably my fault. |
7b691f9
to
e38171c
Compare
Codecov Report
@@ Coverage Diff @@
## master #190 +/- ##
=======================================
Coverage 78.47% 78.47%
=======================================
Files 6 6
Lines 144 144
=======================================
Hits 113 113
Misses 31 31 Continue to review full report at Codecov.
|
This seems to be working well 😄 Gonna just make it prettier |
2620cab
to
abb2960
Compare
I'd like you all to take a look and merge if possible 😄 |
04fcb53
to
b3dbcd1
Compare
I find that the original pull request message would make a good commit message. I prefer having enough information within the Git history to see why things were done. |
@vmx would you prefer not to implement this then and leave the commit message with the PR's title? |
@hacdias I don't know if I understand your comment correctly :) I'm not opposed this feature, I just like having the commit message having enough information so that I can look through the |
@vmx oh, well, okay. It makes sense. I asked you that because I didn't understand 100% of what you said before. Sorry 😆 @diasdavid is there anything missing on this PR? |
@hacdias have you successfully tested this with https://github.com/ipfs/aegir-test-repo? Where can I find the PR that shows that indeed it captures the linting fail? Also, @victorbjelkholm is now the primary captain for this package given that it falls under the responsibilities of the |
@diasdavid it fails when you run |
@hacdias got it, aegir is installing a hook and not necessarily linting the commit messages. What happens when users use the Also, where is the documentation for the commit messages guidelines? We need to have docs to inform users on what the rules are. |
The rules are here. I think I can find better examples though.
Yes, they can bypass it with |
This is tricky. Not a fan of having it preventing commiting, as many time I write commit messages for myself first, then before pushing I do a rebase, fixing the commit messages. This would break that flow. On the other hand, rejecting a push to my own fork because of the commit message feels wrong as well, I might just want to push something temporary. Feels like this is better to be validated in the PR themselves via Jenkins, not locally. So we would just have a new command, Sounds reasonable? Edit:
It would check in the PRs to master if the commit messages in that PR is following the convention. Since everything to master goes through PR (ideally, but currently not enforced everywhere), it should protect master branch. |
I agree with @victorbjelkholm. Though would it be possible to print a warning? That would be useful for newcomers like me, but won't prevent quick hacks. |
btw @hacdias did you get to try out http://commitizen.github.io/cz-cli/ ? |
@victorbjelkholm @vmx yeah, it makes sense. I can change it to a command who does the linting and then we can run it on a CI. 😄 @diasdavid no, but I can check that out. Although, I'm not sure if that would be a great thing to implement here, since we would have to run something like 'yarn commit' instead of our usual 'git commit'. |
So, should I change this to verify the last commit only on PRs? |
I suggest doing what we do on karma, lint on CI. |
Hmm... then I need to force master to get downloaded. Thanks @vmx |
@hacdias Or you drop the |
@vmx that way I would need to change the way every CI checks out the repo, right? |
2e461d6
to
8f00caa
Compare
@hacdias: Good point I haven't thought about that. Just do what whatever makes most sense :) |
68a9f8c
to
7c98329
Compare
@vmx perhaps you could help me: can you find a reason why's only one CI failing with |
@hacdias I have no clue,that really doesn't make any sense. You could perhpas add some debugging to find the issue. I would print the current commit it is on ( |
Could you update this with the changes from master so we can get Jenkins to run tests for all platforms on this PR? |
92768ee
to
ed31ee4
Compare
Done! CIs running. |
ed31ee4
to
7494775
Compare
@hacdias seems this is still failing:
|
@victorbjelkholm I don't know what's happening here and why it does work on some CIs and not on others. It was easier to only check the last commit. What do you think? Do you have an idea of where the error might be? |
Seems to be a few items missing here
|
I changed the code to just use |
It keeps getting the same error on Travis: https://travis-ci.org/ipfs/aegir/builds/376238916#L3785. Although Jenkins doesn't seem to throw any error, it also doesn't seem to be running the command. |
This will use
commitlint
package with their config-conventional set.After you run
npm install
, it sets up as acommit-msg
hook which means it will run before the commit is really made to check the message. It works both on aegir repo itself and on repos that depend on aegir.Closes #59.
(P.S.: Damn you, Windows line endings)