carbon-design-system / carbon-addons-iot-react

A collection of React components shared between IBM Watson IoT products.
https://carbon-design-system.github.io/carbon-addons-iot-react/
Apache License 2.0
96 stars 77 forks source link

Run commit verification before test #1123

Closed davidicus closed 4 years ago

davidicus commented 4 years ago

Run commit validator before we do any other checks. Is annoying to have to go through our entire test and linting only to be told our commit is wrong and must submit again, making all test and linting to run again.

We should also run linting first as test is the longest process.

tay1orjones commented 4 years ago

I'm not sure there's anything we can do here. The pre-commit hook is always ran before the commit-msg hook. There's no option to reconfigure this. githooks docs

We already run linting before testing in our pre-commit hook: https://github.com/IBM/carbon-addons-iot-react/blob/c6a7f379625972d2128008922383462428e69d75/package.json#L50-L53

If the tests pass but your commit message is too long, you can press the up arrow to retrieve your most recently issued command and add --no-verify to the end, which will skip checks.

git commit -m "this msg is invalid. I can still commit with no verify" --no-verify
davidicus commented 4 years ago

This is what I do (I opened this issue after hearing other's frustrations). But it may be dangerous to encourage --no-verify flags to developers who may just use this as a means to never run checks. Not sure if that is a real problem because test will fail and it wont be able to merge but if there is ever times when we are watching build minutes and cost this could be an issue.

davidicus commented 4 years ago

This functionality is currently implemented.