pagarme / git-style-guide

Git styleguide followed by us here at Pagar.me
MIT License
136 stars 8 forks source link

Proposal: Usage of commitizen module. #2

Open armand1m opened 7 years ago

armand1m commented 7 years ago

Hi, I was reading the project's README, and thought it was amazing. You guys did a great job at the rules of how commits should be made. Congratulations to all collaborators :smile:

However, I just saw this part of the style guide: captura de tela 2017-07-22 as 12 02 48

And well, I strongly agree that using the terminal to write git messages isn't really an option. But I do hate opening a text editor every time just to write a commit message, and I strongly believe that I'm not the only one (well, if one feels like that probably there must be others, right?)

For this kind of rule is nice to use a tool like commitizen. commitizen printscreen

Commitizen is nice because it accepts multiple adapters, giving you the hability to even write your own adapters to fit your git message commit style.

Saw you guys like to use something similar to the AngularJS Conventional Commit structure but without the scope of the change, which is very similar to this one: rb-conventional-changelog usage

I personally use it everyday, almost on every commit. It is a nice tool, and can help developers to follow the style-guide without even knowing about it so much since day one 😃

grvcoelho commented 7 years ago

Hi @armand1m that's awesome, I didn't know of the existence of this tool and it seems really interesting.

I think we should keep the main style-guide as tool-agnostic as possible, but I think this would fit really well in a new Tips & Recommendations section :smile:

What do you think? @pagarme/technology?

mccraveiro commented 7 years ago

I also didn't know this tool. We should try it out :)

@armand1m Could you send a Pull Request with the necessary configuration and its usage on README?

Thank you!

vitorabner commented 7 years ago

Nice 🎉

armand1m commented 7 years ago

@grvcoelho @mccraveiro Nice to hear you guys liked it :smile:

No problem, I can separate some time later and write this PR, it is pretty simple so must take me half an hour 😃

I'll try to do this tomorrow =)

MarcoWorms commented 7 years ago

This tool is awesome! It probably helps a lot when you need to teach how to do good commits across the teamd :D

But I agree with @grvcoelho that the styleguide should be tool-free. From what i saw in the example, all the options that this tool helps enforcing can also be enforced by Git Cop (https://github.com/bkuhlmann/git-cop), I don't know if you know this tool but it's also quite good to keep a clean commit history and it acts directly on PRs ;)

gustavolivrare commented 7 years ago

Awesome tool. Thanks for sharing it @armand1m!

claytonsilva commented 7 years ago

@armand1m @vitorabner @gustavolivrare @MarcoWorms see this repo:

https://github.com/claytonsilva/git-integration-quickstart

i will make this configuration in our private repo for use test.

armand1m commented 7 years ago

@claytonsilva it seems great :smile: using this kind of configuration per project is interesting when most of the projects are node.js projects, and you like to have different adapters across different projects (some people like some styles, some don't, it happens), but in the case that you are working with project that don't live in the node.js ecossystem, and want to use the commitizen package, you can do this:

Globally installing commitizen

npm install -g commitizen cz-conventional-changelog
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc