-
Notifications
You must be signed in to change notification settings - Fork 934
Using config example gives error running 19.0.3 #3947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@marcalexiei have you tried giving it an input that does conform to the format? |
Here is how to reproduce the issue I'm reporting...
|
Did you try latest https://github.com/conventional-changelog/commitlint/releases/tag/v19.0.3? Global installation usage should have been fixed in v19.0.1. |
Yes, this was done 2 days ago. You can reproduce it right now following the above instructions. |
@nkukard I can't reproduce it with the issue steps. |
Did you try the docker container reproducer and commands I pasted? This is the official alpine image, I can't see how it cannot be reproducible. |
For clarity sake this is the latest official alpine image...
|
// test.mjs
import globalDirectory from 'global-directory';
console.log(globalDirectory.npm.packages) ![]() It's a upstream issue, please report to https://github.com/sindresorhus/global-directory instead. And also, I recommend not using global usage any longer. Besides, it should also occur on v18, doesn't it? |
![]() It seems But AFAIK, @escapedcat Should we change to use IMO, we should drop global installation usage in next major version. |
I'm very sure many people are using commitlint to lint commits with repositories that are not node based, how would dropping global installation usage affect that? |
OK, interesting, any idea to keep supporting global installation usage easily and maintainable? |
So basically to explain this use case , we have multiple docker containers that run in parallel against MR/PR's being submitted. Each of the validation containers implements a specific type of check, for instance shellcheck, commitlint ... etc. The repositories themselves can be anything, from perl libraries, to python libraries, to apps, to distribution packages, Ansible playbooks ... etc. I'd say there is a valid use case for a global installation, if commitlint were to be installed during this process in the project top folder it would modify the status of the repository unless .node_modules and packages.json were added to .gitignore on every project. To be honest thinking of this makes me shudder. |
I'm not against to support global installation considering the users not using node primarily. I'm just trying to find a good way to support it. As you can see, By the way, did you use commitlint v18 previously as global dependency? And does it work as expected? |
No probs.
My CI/CD pipeline for commitlint started failing when v19 was released. It was working before that with v18. I'm not sure if maybe another dep may of been updated as I very briefly tried installing <v19.0.0 and it failed in the same way. I'm currently using |
I checked eslint, it is also not recommended to used as global. https://eslint.org/docs/latest/use/getting-started#global-install |
I think however there is a difference here. Those using commitlint to lint non JS repositores and those using commitlint to lint JS repositories where commitlint may form part of packages.json? eslint would be the latter where commitlint could be added to packages.json, the former however would not have a packages.json. |
I mean, I didn't find a good and standard way to resolve global modules and even for |
What's your opinion on |
I'm somewhat torn in between... Usually I try to find a matching tool in the used env, i.e. in rust I used this before: https://convco.github.io/ Maybe another tool is supporting this case better than commitlint does? If someone finds a nice and maintainable way to make this work with commitlint that's great. Sorry if this not the answer you were looking for. |
@nkukard why not use |
old docs outdated conventional-changelog/commitlint#3947
Steps to Reproduce
Current Behavior
Results in ...
Expected Behavior
Before 19.0.0 it resulted in ...
Affected packages
Possible Solution
No response
Context
I'm running CI/CD pipelines with many of my software projects and this was picked up in our commitlint job test.
commitlint --version
@commitlint/[email protected]
git --version
v2.44.0
node --version
21.6.2 (fails on 18 & 20 that I test too)
The text was updated successfully, but these errors were encountered: