GithubHelp home page GithubHelp logo

commitlint_config-typo3's Introduction

commitlint/config-typo3

Donate GitHub GitHub issues Lint Code Base

This is a config file, if you want to use commitlint in TYPO3 projects, to make sure your commit messages are in the correct format as described in the TYPO3 documentation

If you use git at the command line

I would recommend to use typicode/husky:

yarn add husky --dev

or

npm install husky --save-dev

You also need commitlint, commitlint/config-conventional and @commitlint/parse:

yarn add commitlint --dev
yarn add @commitlint/config-conventional --dev
yarn add @commitlint/parse --dev

or

npm install --save-dev @commitlint/config-conventional @commitlint/cli @commitlint/parse

Create a .huskyrc file in the root folder of your project, which runs commitlint during the Git commit-msg hook:

{
    "hooks": {
        "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
}

Finally copy the commitlint.config.js to the root of your project and you are ready to go.

If you use git in Visual Studio Code

First go to the Extension-Manager in Visual Studio Code and install the extension "VSCode Conventional Commits".

To make our own commitlint.config.js work, you have to install commitlint/config-conventional. You can install it localy (which I recommend) or globaly:

yarn add @commitlint/config-conventional --dev

or

npm install --save-dev @commitlint/config-conventional

Finally copy the commitlint.config.js to the root of your project.

Restart Visual Studio Code and it should work.

Info on how to use "VSCode Conventional Commits" you can find in the documentation.

Known bugs

According to the TYPO3 documentation, there should be no colon ":" after the typ.

[TASK] Remove colon in pattern -> correct
[TASK]: Remove colon in pattern -> false

But the "VSCode Conventional Commits" plugin for Visual Studio Code puts always a colon between the typ and the subject. Therefore the headerPattern has to tolerate the colon.

Additional resources

commitlint_config-typo3's People

Contributors

starraider avatar

Watchers

 avatar

commitlint_config-typo3's Issues

[BUG] A colon (:) has to be put after the type for VSC extension

Describe the bug
The VS Code extension "VSCode Conventional Commits" always puts a colon ":" after the type. Therefore the pattern has to be changed accordently.

To reproduce
Steps to reproduce the behavior:

  1. Install "VSCode Conventional Commits" in VSC
  2. Commit a change and use a typ like [BUGFIX]
  3. In the generated commit message there is always a colon after the typ, like [BUGFIX]:

Expected behavior
According to the TYPO3 documentation there should be no colon after the typ.

[BUG] Rules for type-empty and subject-empty should be error

Describe the bug
Rules for type-empty and subject-empty are not working correctly. So they have to be set to level 0.

To reproduce
Steps to reproduce the behavior:

  1. Open commitlint.confg.js in your editor
  2. Set type-empty and subject-empty to level 2 (error)
  3. Save the changes
  4. Test: echo '[BUGFIX]: Foo bar' | npx commitlint

Expected behavior
'[BUGFIX]: Foo bar' is correct and should not through any error.

Application logs
⧗ input: [BUGFIX]: Foo bar
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]

✖ found 2 problems, 0 warnings

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.