Skip to content
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

Added commit message validation to Travis CI #1989

Conversation

twolfson
Copy link
Contributor

When working on a repo, I like to commit frequently in a working branch. The ghooks were getting on my nerves so I removed them.

However, I have realized that I was able to open #1984 with a bad commit message format as a result. To remedy that, I'm adding the commit message validation to Travis CI.

In this PR:

  • Added validate-commit-msg to npm run travis to enable non-local message validation

@twolfson twolfson force-pushed the dev/add.validate.commit.message.to.travis branch from becce83 to d9c8e39 Compare March 12, 2016 22:05
@twolfson
Copy link
Contributor Author

Ah, nvm. It looks like validate-commit-msg is only built to handle loading from files (e.g. .git/COMMIT_MSG). This won't work well with Travis CI without a long workaround =(

@twolfson twolfson closed this Mar 12, 2016
@twolfson twolfson deleted the dev/add.validate.commit.message.to.travis branch March 12, 2016 22:15
@dignifiedquire
Copy link
Member

Thanks, the idea is good though. Ideally we would have another check different from travis showing up similar to how we have the CLA check showing up which validates the commit message. But I haven't figured out how to do that yet.

@twolfson twolfson restored the dev/add.validate.commit.message.to.travis branch March 13, 2016 22:22
@twolfson
Copy link
Contributor Author

@twolfson twolfson reopened this Mar 13, 2016
@twolfson
Copy link
Contributor Author

I will take a similar attempt at a setup. Although, I think we will want a bash script to handle generating a file for the commit message (we could add a PR to support - for stdin on verify-commit-msg but this is simpler)

@twolfson twolfson force-pushed the dev/add.validate.commit.message.to.travis branch 2 times, most recently from bdbc478 to 9f4a036 Compare March 13, 2016 23:05
@twolfson twolfson force-pushed the dev/add.validate.commit.message.to.travis branch from 9f4a036 to 8f2a9dd Compare March 13, 2016 23:09
@twolfson
Copy link
Contributor Author

Alright, this PR is now good to go. I went with the matrix example as mentioned earlier. It's a bit unfortunate that we still go through installing Firefox for our one-off environment but such is life =/

Here's an expected failing build (this revision wasn't using --no-merges so it validated against a merge commit's message):

https://travis-ci.org/karma-runner/karma/builds/115744881

Here's a passing build:

https://travis-ci.org/karma-runner/karma/builds/115746435

@dignifiedquire
Copy link
Member

This is great thanks @twolfson, just going to let travis run its course before merging :)

dignifiedquire added a commit that referenced this pull request Mar 18, 2016
…e.to.travis

Added commit message validation to Travis CI
@dignifiedquire dignifiedquire merged commit 10ae8d0 into karma-runner:master Mar 18, 2016
@dignifiedquire
Copy link
Member

Thanks again for this!

@twolfson twolfson deleted the dev/add.validate.commit.message.to.travis branch March 19, 2016 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants