-
Notifications
You must be signed in to change notification settings - Fork 933
feat(core): Allow to configure with json, yaml and package.json #74
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
Conversation
c2cbabf
to
8bc87e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot - Great work! I have two comments on the changes to file
, could you have a look?
@commitlint/core/src/load.js
Outdated
const explorer = cosmiconfig('commitlint', { | ||
rcExtensions: true, | ||
sync: true, | ||
stopDir: process.cwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmiconfig
reintroduces find-up
mechanics - I think the current git root would be more appropriate as stopDir
.
I'd also prefer using this in the async variant. Making file
async
and await
ing explorer.load
should make that a breeze.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but how can I obtain the git root ? Also what if the project is not a git repo ?
I will make the change for using async, but we'll have to set the tests for load
in serial as they change the current dir.
I changed the code to use the async function of |
An example on how to find the git root can be found in core/read.js#74. Given I think it is fine if you just copy the relevant implementation for the time being, I'll move that to a separate package eventually |
Ok but that mean I need a The other solution is to create a git repo in a temp directory for each test and copy the content of the fixture subdirectory in it. But that's a lot of changes in the |
Option 2 sounds good |
Ok I'll have to copy the whole content, recursively, of each fixture sub-folder into the temp git repo. |
The cli package uses sander for |
I made the changes. Let me know where to put them and if you want me to do that. |
2dcc27f
to
927b4f8
Compare
Looks good, thanks. I'll handle the dedupe at some later time. I am on vacation till 3th Oct, will make an effort to merge it then! |
Moving this to #83 |
Landed, thank you! |
Published with v4.0.0 🚀 |
Fix #73