-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Allow config to be provided via command-line #304
Allow config to be provided via command-line #304
Conversation
@cameronhunter Could you investigate the CI failures? |
Codecov Report
@@ Coverage Diff @@
## master #304 +/- ##
==========================================
+ Coverage 91.86% 95.95% +4.09%
==========================================
Files 10 10
Lines 172 173 +1
Branches 26 27 +1
==========================================
+ Hits 158 166 +8
+ Misses 13 7 -6
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
@sudo-suhas The CI failures were:
|
Hey @cameronhunter, thanks for this. I did not know about the jest snapshot serializer. Cool stuff. Regarding 99d44b9, do you think it is possible that the whitespace issue was because the editor removed trailing whitespace? I personally have that enabled in vscode.
Actually, I don't think this is the case. I am only guessing, but I think this has something to do with running the code in sync vs async. In all our current tests, since However, I think a lot of complexity was added in the way it has been implemented now. I took some of your commits and tweaked them in #311. Could you please remove commits ce2c8d7, 327f1c7, 58b034a, 505654a, 40b399a, afe2fac and port the changes from d512c63 instead? You can use git reset to remove commits. Let me know if you need any help.
Edit: If you could rebase this on master, that would be good too. |
d55b3be
to
7b6f85e
Compare
@sudo-suhas I've rebased on To prevent a breaking change, I reordered the parameters to the main lib to pass the logger first (with a fallback value of CI is passing – let me know if there's anything more you'd like included before merging. |
test/__mocks__/my-config.json
Outdated
@@ -0,0 +1,6 @@ | |||
{ | |||
"verbose": false, |
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.
Could you change this to true
? We'd be able to see the config in the snapshot then.
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.
Sure
Configuration file can be provided via a -c or --config commandline parameter. This allows users to be explicit with where their configuration lives rather than relying on cosmiconfig path search.
7b6f85e
to
49d83f5
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.
Great Work @cameronhunter! LGTM.
@sudo-suhas Can you speak to a timeline of merging and publishing the new version? |
I figured I'd wait a couple of days for comments, if any, from @okonet and @luftywiranda13. I'll wait till end of day and merge it in. It should be released immediately via semantic-release. |
is it better if we also add some additional helpful things for the |
@luftywiranda13 I think that makes sense. |
@cameronhunter This has been released in |
Summary
I use
lint-staged
as a pre-commit hook and would like to explicitly provide the config file location. This PR usescommander
to parse the command-line argument and passes it ascosmiconfig
'sconfigPath
option. This allows the config file to be any format already supported.Test plan
I've added tests and updated the documentation.