GithubHelp home page GithubHelp logo

Comments (9)

thclark avatar thclark commented on June 2, 2024 1

@cortadocodes I've assigned this to you, we'll come to it fairly soon I think, as the more I think about it, the more it's really going to make a difference to workflow.

from conventional-commits.

thclark avatar thclark commented on June 2, 2024 1

@cortadocodes if you're building a small equivalent of the conform tool, plus a pre-commit hook, perhaps we'll group them in this repo and rename the repo (eg pre-commit-conventional-commit), rather than having the tool in a separate repo, and the hook in this one.

Probably scratch that last, I didn't realise how small the checker would be.

from conventional-commits.

cortadocodes avatar cortadocodes commented on June 2, 2024

I've had a look at the conform tool written in go which gives some useful features for this:

  • Enforces Conventional Commits
  • Enforces header of given length in the imperative with an ending that isn't invalid (e.g. a full stop)
  • Allows enforcing (or not) of the presence of a body
  • Spell checks the commit message in the given language
  • Allows a discrete set of custom commit codes (e.g. the ones I've already been using)

For me currently, it works if a pre-built release is downloaded and manually added as a hook in the .git directory, but it doesn't seem to work properly with

  • go get
  • go build
  • The provided GitHub action
  • The provided pre-commit hook

So I think it may be better to write our own, but I'm wondering which of the features above are must haves and which are could haves @thclark?

from conventional-commits.

cortadocodes avatar cortadocodes commented on June 2, 2024

It seems to me like these are the must-haves:

  • Enforces Conventional Commits
  • Enforces header of given length
  • Enforces header with an ending that isn't invalid
  • Allows a discrete set of custom commit codes

from conventional-commits.

thclark avatar thclark commented on June 2, 2024

So I think it may be better to write our own,

Our own what? Conform tool? Or GHA and pre-commit hook to run the existing conform tool? The latter, yes - the former would very much raise an eyebrow at how far deep we're getting.

It seems to me like these are the must-haves:

  • Enforces Conventional Commits
  • Enforces header of given length
  • Enforces header with an ending that isn't invalid
  • Allows a discrete set of custom commit codes

I agree that skipping the spell checker is sensible. It's mildly annoying when there are typos, it's a crashing marshmallowman on your dev flow when the spell checker doesn't have your word or the thing you deliberately want to type.

It seems like you've intentionally missed the imperative tense constraint on the header (e.g: enforcing the form between "fixes the issue" (passive) "fix the issue" (imperative)). Why is that? Anything to add to the pros and cons below?

Pros:

  • Automated releases will read strangely if the tenses are mixed
    Cons:
  • it may cause too much friction as we adopt the tool (and have our developers adopt it)
  • Similar logic might apply as for the spellchecker (too constraining when you really are wanting to type a specific message).

from conventional-commits.

cortadocodes avatar cortadocodes commented on June 2, 2024

I meant writing our own conform tool, pre-commit package, and GHA. I've started doing it and it's turnint out to be quite simple - I'm nearly done!

Agree about spell checker - that's why I left it out.

With the imperative, I think all commits should be in the imperative but I'm aware that not everybody wants to do that. I also didn't know how to easily check if a sentence is in the imperative without NLP, although it looks like conform just checks if the first word in the header after the commit code is in a list of known imperative verbs.

I do think it's part of good practice to make commits imperative, so I could/should probably easily add what conform has.

from conventional-commits.

thclark avatar thclark commented on June 2, 2024

@cortadocodes if you're building a small equivalent of the conform tool, plus a pre-commit hook, perhaps we'll group them in this repo and rename the repo (eg pre-commit-conventional-commit), rather than having the tool in a separate repo, and the hook in this one.

from conventional-commits.

cortadocodes avatar cortadocodes commented on June 2, 2024

This is now released in https://github.com/octue/octue-sdk-python/releases/tag/0.1.20

The only difference from the issue description is that we agreed to only check if the setup.py version is semantically correct rather than actually updating it - this allows us complete control over the version number of the next release in case we need to override what git-mkver says.

from conventional-commits.

cortadocodes avatar cortadocodes commented on June 2, 2024

This has now also been rolled out to amy, twined, and planex-site.

from conventional-commits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.