vivaxy / vscode-conventional-commits

💬Conventional Commits for VSCode.
https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits
MIT License
322 stars 35 forks source link

[BUG] commitlint.config.js gets ignored #29

Closed Starraider closed 4 years ago

Starraider commented 4 years ago

Describe the bug

My commitlint.config.js gets ignored.

Maybe you can provide a sample file how the commitlint.config.js has to look like to make it work?

To reproduce

Steps to reproduce the behavior:

  1. Install extension
  2. Restart VS Code
  3. Make new commitlint.config.js
  4. Add some rules
  5. Test commit

Here you can find my commitlint.config.js

Expected behavior

My type-enums should be displayed, but they are not.

Application logs

Started
VSCode version: 1.49.0-insider
VSCode Conventional Commits version: 1.11.0
Git version: 1.0.0
autoCommit: true
gitmoji: false
emojiFormat: code
scopes: deployer
lineBreak: 
git.enableSmartCommit: true
git.smartCommitChanges: all
git.postCommitCommand: sync
arg: /Users/sven/Documents/Projekte/devTypo3ddev
git.repositories: /Users/sven/Documents/Projekte/devTypo3ddev
workspacceFolders: /Users/sven/Documents/Projekte/devTypo3ddev
commitlintRuleConfigs: {}
commitMessage: {
  "type": "test",
  "scope": "",
  "gitmoji": "",
  "subject": "Fix commitlint.config.js",
  "body": "",
  "footer": ""
}
message: test: Fix commitlint.config.js
inputBox.value: test: Fix commitlint.config.js
Finished successfully.
vivaxy commented 4 years ago
  1. Please make sure you have installed @commitlint/config-conventional.
  2. Please make sure your commitlint config is valid. See Commitlint Website.
Starraider commented 4 years ago

I don't understand. Where do I have to install @commitlint/config-conventional? I'm using Visual Studio Code with your vscode-conventional-commits extension, but I want to change the type-enum. I don't have a Node project.

So where or how do I have to install @commitlint/config-conventional?

You write in your README: "Respect commitlint configs." So you don't read the commitlint.config.js?

vivaxy commented 4 years ago

You have to install @commitlint/config-conventional in your project or in global. And your commitlint.config.js is not valid. Please correct it according to Commitlint docs.

By design, vscode-conventional-commits extension does not install commitlint configs. Because there are lots of configs and lots of versions. If you'd like to use commitlint, please at least follow the commitlint config specification.

Here's some details about logic. The @commitlint/config-conventional preset represents some commitlint rules. The vscode-conventional-commits extension reads the config file, and finds out the preset rule name as @commitlint/config-conventional. But the extension does not know what exact the rules are, until it finds out the detailed @commitlint/config-conventional config files. You can install @commitlint/config-conventional in your project, which is recommended. Or you can copy the @commitlint/config-conventional rules to your commitlint.config.js.

Thank you for your question, looking forward to your response.

Starraider commented 4 years ago

Ok, thanks for you explanation. I installed @commitlint/config-conventiona and fixed my commitlint.config.js and and it works.

Unfortunately after every "type" you put a colon ":", which is against the commit rules for TYPO3 projects. Is it possible to get rid of the colon?

vivaxy commented 4 years ago

vscode-conventional-commits follows Conventional Commits which is not compatible with Commit Message rules for TYPO3 CMS. Maybe you can try to find or build another extension. 😃