Can the bot comment include an example of a good commit message?
Telling users that "Commits must be in the following format: %{type}(%{scope}): %{description}" requires them to mentally parse and figure out what this means. Giving an example along the lines of "perf(backend): optimized db access" would make this easier.
It's a very nice idea, but the validation rules are extremely limited.
Perhaps I'm wrong, but all of the rule options on the site look like they could have been implemented via regular expressions. Given the technical expertise of your intended customers, why not allow them to set a list of rules in the format: [regex, error-message], e.g.
"^.{0,50}\n" "The subject should be 50 characters or under"
"^.+\n(.{0,72}\n)*$" "The body should have lines of 72 characters or under"
"^\p{Upper}" "The subject should be capitalized"
I think doing it like that is a neat idea. Perhaps there could be an "advanced" page which is as you describe and the current method could be the "simple" version?
I didn't really understood the format rules, so if the author posted this, a help section would help. I try to enforce
'%(type) #xxxx(: | -) %{description}'
How would you do that? #xxxx is just an issue number, so it can be #23891, and after that I want a separator from the description, semi colon or hyphen are fine. Probably %{scope} can be used but I didn't really understand it from the inline help, sorry!
Hi, thanks for the feedback, it would be great to be used by a project like Foreman!
Currently the string for the format only allows the 3 defined variables, type, scope and description. I have been using this style at https://github.com/Gazler/changex/commits/master to give you an idea of how it works.
I was concerned that the format string might be a little weird to get from the help. I will try and clear this up a bit.
I have attempted to build the string that you requested, currently an or separator is not supported, but I can take a look at adding it in.
Here are the format strings that I think match your use case. Using a colon as a separator:
After the PR is opened is too late to warn about commit messages. They can't be changed without a destructive push to the remote, which is generally a no-no for a public branch, and when using github, closes the PR automatically. The correct place to do this is, I believe, in the `commit-msg` hook: http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Have you thought about opening this up for more than just commit messages?
Many projects need to check a number of things on PRs, e.g. enforce coding style, bugfix has a corresponding test, user signed the CLA, owner of %{scope} is notified for review, etc. That would obviously need a way to tie into external/custom tools as everybody validates these things differently.
I think there are several avenues that could be explored with this. I wanted to stay away from explicitly checking the code initially, as there are other tools aimed at that specific task, however there is no reason something like this couldn't be added into GitCop at a later date.
I had the idea of checking that the user exists in a list of users by specifying a JSON list of users. This means that it could be used to check if a CLA has been signed, but there are other applications too. Does this seem like a reasonable way to do it?
I like the idea of ensuring a test has been added, not sure how to tackle it, but it is certainly worth keeping in mind.
Stash has a number of integration points where similar checks could be applied, the most similar to GitCop being a merge check. That said, a pre-receive hook would make a lot more sense.
[+] [-] akoeplinger|11 years ago|reply
Telling users that "Commits must be in the following format: %{type}(%{scope}): %{description}" requires them to mentally parse and figure out what this means. Giving an example along the lines of "perf(backend): optimized db access" would make this easier.
[+] [-] Gazler|11 years ago|reply
[+] [-] weavejester|11 years ago|reply
Perhaps I'm wrong, but all of the rule options on the site look like they could have been implemented via regular expressions. Given the technical expertise of your intended customers, why not allow them to set a list of rules in the format: [regex, error-message], e.g.
[+] [-] Gazler|11 years ago|reply
[+] [-] eLobato|11 years ago|reply
I didn't really understood the format rules, so if the author posted this, a help section would help. I try to enforce
How would you do that? #xxxx is just an issue number, so it can be #23891, and after that I want a separator from the description, semi colon or hyphen are fine. Probably %{scope} can be used but I didn't really understand it from the inline help, sorry![+] [-] Gazler|11 years ago|reply
Currently the string for the format only allows the 3 defined variables, type, scope and description. I have been using this style at https://github.com/Gazler/changex/commits/master to give you an idea of how it works.
I was concerned that the format string might be a little weird to get from the help. I will try and clear this up a bit.
I have attempted to build the string that you requested, currently an or separator is not supported, but I can take a look at adding it in.
Here are the format strings that I think match your use case. Using a colon as a separator:
Using a hyphen as a separator: I hope this makes sense, let me know if you get it working![+] [-] Myrmornis|11 years ago|reply
[+] [-] iandanforth|11 years ago|reply
[+] [-] akoeplinger|11 years ago|reply
Many projects need to check a number of things on PRs, e.g. enforce coding style, bugfix has a corresponding test, user signed the CLA, owner of %{scope} is notified for review, etc. That would obviously need a way to tie into external/custom tools as everybody validates these things differently.
[+] [-] Gazler|11 years ago|reply
I think there are several avenues that could be explored with this. I wanted to stay away from explicitly checking the code initially, as there are other tools aimed at that specific task, however there is no reason something like this couldn't be added into GitCop at a later date.
I had the idea of checking that the user exists in a list of users by specifying a JSON list of users. This means that it could be used to check if a CLA has been signed, but there are other applications too. Does this seem like a reasonable way to do it?
I like the idea of ensuring a test has been added, not sure how to tackle it, but it is certainly worth keeping in mind.
[+] [-] tokenrove|11 years ago|reply
[+] [-] Gazler|11 years ago|reply
The goal for GitCop is to be fast and easy to set up in a way that integrates well into a GitHub pull request based flow.
[+] [-] tjbiddle|11 years ago|reply
Great work!
[+] [-] Gazler|11 years ago|reply
An example of the messages GitCop outputs can be seen at https://github.com/Gazler/gitcop-test/pull/2 if you are interested.
[+] [-] thestonefox|11 years ago|reply
[+] [-] Gazler|11 years ago|reply
[+] [-] dmooney1|11 years ago|reply
[+] [-] mindsocket|11 years ago|reply
Disclosure: I work for Atlassian
[+] [-] Gazler|11 years ago|reply
[+] [-] jimmyboyb|11 years ago|reply
[+] [-] warrenmcwin|11 years ago|reply
[+] [-] unknown|11 years ago|reply
[deleted]