commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

fix: lint nested folder

Open tomhoad opened this issue 1 year ago • 0 comments

Expected Behavior

commitlint should run to completion

Current Behavior

 git commit -m "this should fail"

⧗   input: this should fail
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://commitlint.js.org/#/?id=getting-started
    - Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/index.js [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg hook exited with code 1 (error)

Affected packages

  • [X] cli
  • [ ] core
  • [ ] prompt
  • [ ] config-angular

Possible Solution

No response

Steps to Reproduce

mkdir test/package
cd test
git init
cd package
npm install --save-dev @commitlint/config-conventional @commitlint/cli
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
npm install husky --save-dev
cd .. && npx husky install package/.husky
npx husky add package/.husky/commit-msg  'npx --no -- commitlint --edit ${1}'
cd package
git commit -m "this should fail"

⧗   input: this should fail
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://commitlint.js.org/#/?id=getting-started
    - Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/index.js [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg hook exited with code 1 (error)

Context

My use case is that the project is a template folder that uses a nested folder as the template contents (specifically for the dotnet 'new' CLI). I want the template users to use commitlint in their templated projects.

commitlint --version

"@commitlint/cli": "^17.6.5",

git --version

git version 2.39.0.windows.1

node --version

v18.16.0

tomhoad avatar Jun 06 '23 15:06 tomhoad