jzaefferer/commitplease

Review popular (web/JS) open source projects for common styles

Closed this issue · 14 comments

Project needs to use npm for installing dependencies, doesn't really matter what it does otherwise.

JSHint has something vaguely similar to Angular: https://github.com/jshint/jshint/commits/master

ESLint seems pretty similar to jQuery: https://github.com/eslint/eslint/commits/master

etc. pp.

I have ordered the following list by how useful, imo, commitplease might be for the project. First four look rapidly developing with quite a few people working together, so I think we need to start with those.

  1. Ember PR emberjs/ember.js#13893
    1. Contributing has special prefixes for commit messages
    2. Using this in other repos, too, like ember-data
  2. ReactJS PR facebook/react#7347
    1. Contributing does not mention commit style
    2. Mostly link to issue/pull request in first line
  3. airbnb/javascript issue airbnb/javascript#965
    1. No contributing, no commit style discussion
    2. Lead contributor alone uses sort of tags in first line
    3. No contributing instructions, no website, no wiki -> just do it
  4. Chart.js, issue chartjs/Chart.js#3147
    1. Contributing asks for clear commit messages
    2. No consistent message style
  5. JSHint, issue jshint/jshint#2983
    1. Contributing mentions jQuery-like style (different look, same feel)
  6. ESLint, issue eslint/eslint#6706
    1. Contributing describes a message style very similar to jQuery, but no link to it.
    2. Makefile.js has validation logic that is slightly more specific than style guide
  7. Modernizr, issue Modernizr/Modernizr#2050
    1. Did not find any instructions for contributing, only using
    2. Sometimes angular-like commit style
    3. Sometimes issue number in first line
  8. Backbone.js, issue jashkenas/backbone#4065
    1. Contributing does not mention commit style
    2. No commit style discussion found
    3. Mostly a capitalized verb in imperative starts the message
    4. Sometimes first line includes link to issue/pr
  9. Jest
    1. Contributing does not mention commit style
    2. Mostly link to issue/pull request in first line
  10. impress.js
    1. Contributing only specifies a “release” commit message
    2. No commit style discussion found
    3. No explicit commit message style guide. Capitalize and use a verb in imperative is the de-facto standard
  11. vue.js
    1. Contributing does not mention commit style
    2. Sometimes capitalized (or not) verb in imperative
    3. Sometimes issue number in first line, in parens
    4. Sometimes a [build] or [release] tag
  12. h5bp
    1. Contributing only asks for a “clear title and description”
    2. No commit style discussion found
    3. Mostly a capitalized verb in imperative starts the message
    4. Sometimes “Doc:” or “Docs:” start a doc-change commit
    5. Sometimes [skip ci] tag at the end of first line
  13. node
    1. Contributing describes a commit style close to jQuery
  14. Meteor
    1. Contibuting links to a style guide for code style and commit messages. Only code style is actually described there
    2. Lead developer capitalizes commit message and ends first line with a dot. That is the de-facto commit message style.

Sounds good, let's start with those four. Could you summarize here what you would suggest to each? Like style or other options.

Btw. what about jshint and eslint (I mentioned them above)?

I have now added both jshint and eslint to the list above. Both these projects actually describe a style for commit messages. In the case of eslint there is even automatic checking for that style (that has extra corner cases compared to style guide).

So, I do not know what the best approach would be here:

  1. We could try to convince them to switch to one of the styles that we already support. Probably jQuery style suits both jshint and eslint best.
  2. We could implement support for those styles in commitplease and simply let jshint add automatic checking and eslint -- drop some of their in-house scripts. This is probably the way to go?

The eslint script runs as part of a build (I guess), which commitplease doesn't do by default. They could use the commitplease validation module though, instead of implementing their own logic. So I think for eslint we should start with a discussion. See if they're interested in adopting commitplease (it provides more immediate feedback while committing!). If yes, if they want to keep their current format or would consider adopting another. If they want to keep theirs we can consider adding support in commitplease. Though I see that more of a last resort.

More or less the same for jshint: Open an issue where you suggest they adopt the jQuery style with commitplease.

grep -r Makefile.js from the repo root shows that Makefile.js is just a collection of functions that are called manually by running various npm run some-script. In particular, I am pretty sure that checkGitCommit is run manually and not actually different from a standalone validate-commit-msg.js script that we saw in Angular. Here is my take at the issue text for eslint, please review.

That looks great!

Only nitpick: commitplease is used by jQuery Core, jQuery UI, jQuery Mobile, Globalize and QUnit. Probably others, but npm doesn't allow search for dev-depended-on packages. Linking to the jQuery Core PR makes it look like they aren't actually using it, yet.

Thanks! I have addressed the nitpick and created the issue.

Created an issue to airbnb/javascript#965

Created an issue to Modernizr/Modernizr#2050

Created an issue to chartjs/Chart.js#3147

Created an issue to jashkenas/backbone#4065

I think the outreach last year was plenty. Adoption wasn't anywhere near to what we've hoped for, but that's okay.