You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use submodule instead of project git repository
file:///***/Project1/node_modules/@commitlint/cli/lib/cli.js:127
throw err;
^
Error: ENOTDIR: not a directory, open '/***/Folder1/.git/COMMIT_EDITMSG'
at async open (node:internal/fs/promises:637:25)
at async Object.readFile (node:internal/fs/promises:1246:14)
at async getEditCommit (file:///***/Project1/nextjs-boilerplate/node_modules/@commitlint/read/lib/get-edit-commit.js:13:22)
at async main (file:///***/Project1/nextjs-boilerplate/node_modules/@commitlint/cli/lib/cli.js:174:19) {
errno: -20,
code: 'ENOTDIR',
syscall: 'open',
path: '/***/Folder1/.git/COMMIT_EDITMSG'
}
Expected Behavior
Use Project1's git folder instead of Folder1 git file.
Affected packages
cli
core
prompt
config-angular
Possible Solution
Add option to searchDotGit function to pass these options to the findUp. This way, we can exclude files and select only directories.
Steps to Reproduce
. ├── Folder1 (submodule) │ ├── .git (file) │ │ ... │ ├── Project1 │ │ ├── .git (folder) │ │ │ ├── COMMIT_EDITMSG │ │ ...
yarn cm
(see Extra section)Extra
.husky/commit-msg
commitlint.config.ts
.czrc
package.json
Current Behavior
Trying to use submodule instead of project git repository
Expected Behavior
Use Project1's git folder instead of Folder1 git file.
Affected packages
Possible Solution
Add option to
searchDotGit
function to pass these options to thefindUp
. This way, we can exclude files and select only directories.https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/top-level/src/index.ts#L23-L24
commitlint --version
@commitlint/cli@19.2.2
git --version
git version 2.44.0
node --version
v21.7.3
The text was updated successfully, but these errors were encountered: