question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addition of story as commit type

See original GitHub issue

conventional-changelog provides an enum of available commit type values. With the prevalence of storybook in projects, this ticket is advocating for another type to be added to the enum for story to represent commits that contain the addition of storybook stories being added to the repo.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Context

With the addition of storybook to many repos I am working on, I would like to continue to be able to use commitlint and conventional-changelog to enforce good commit hygiene. The addition of a story type, I feel more accurately reflects commits to my repo where I am adding stories.

Your Environment

Executable Version
commitlint --version ^7.0.0
git --version 2.22.0
node --version 12.6.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
byCedriccommented, Sep 28, 2019

My pleasure! 😄 If you want a fix now, I’d recommend adding your own set of enums to your project. You can still “extend” from the configuration but only overwrite the type enums 😄 Here is a config for that:

module.exports = {
    extends: '@commitlint/config-conventional',
    rules: {
        'type-enum': [2, 'always', [
            'build',
            'chore',
            'ci',
            'docs',
            'feat',
            'fix',
            'perf',
            'refactor',
            'revert',
            'style',
            'test',
            'story',
        ]],
    },
};

or a more complex approach, without the need of defining everything again:

const config = require('@commitlint/config-conventional');
const types = config.rules['type-enum'][2];

config.rules['type-enum'][2] = ['story'].concat(types);

module.exports = config;
2reactions
byCedriccommented, Sep 28, 2019

I think this is also relevant for you. I haven’t got around to update commitlint to the latest conventional commits specification, but basically in a later (probably major) version the default conventional config should be updated without strict type enums. This is because the original spec doesn’t “forbid” to use any type other than fix and feat. Of course, when this is changed we will document an upgrade guide and a way of how to retain the old behavior of stricter types.

I know this doesn’t help you right now, but I hope this gives you some info for the near future 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding code commit comments to stories - Pivotal Tracker
When a commit is made to the SCM, a trigger can call the Tracker API to add a story comment with the commit...
Read more >
Prepending Your Git Commit Messages with User Story IDs
Prepending Your Git Commit Messages with User Story IDs · Step 1: Create the hook file · Step 2: Add the code to...
Read more >
Telling the Story of Your Project one Commit at a Time
As far as I can tell, there are two types of commit messages, ones that are informative and well written, and “some changes...
Read more >
Commit Changes Overview
When committing changes in a user story, the changes are committed into a new user story feature branch that is automatically created by ......
Read more >
How to Write Better Git Commit Messages – A Step-By-Step ...
To ensure that these committing conventions remain consistent across developers, commit message linting can be configured before changes are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found