-
-
Notifications
You must be signed in to change notification settings - Fork 38
feat: add cli flag --json #145
feat: add cli flag --json #145
Conversation
If the --json flag is used the missing and unused dependencies are printed as json object Signed-off-by: Merzough Münker <mmuenker@digitaix.com>
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.
Overall 👍
The README.md
needs an update as well, but no blocker, if nothing else I can do that when I find some time to merge and release this
// eslint-disable-next-line promise/always-return | ||
process.exit(args.ignore || !failed ? 0 : 1) | ||
process.exit(args.json || args.ignore || !failed ? 0 : 1) |
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.
I don't think --json
should imply --ignore
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.
You are right. This is not a good idea. I am not sure at the moment why I am adding this.
@@ -2,6 +2,7 @@ | |||
.DS_Store | |||
/node_modules | |||
/*.tgz | |||
.idea |
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.
This belongs in your local global .gitignore
instead
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.
For all projects in my company, some files are committed from the .idea
folder to the Git repository. This is done to enforce company-wide styling and IDE configurations. So this is not a viable solution for developers using Webstorm.
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.
Just a heads up but this is an open source project, not a project in your company. Typically open source avoids having every contributor adding their custom editor configurations into .gitignore
over time, and instead asks you as a contributor to be mindful and not commit irrelevant files. The easiest way to do that is add your own global .gitignore
file locally, which you can do once instead of for every project you contribute to. GitHub has a tutorial here.
So this is not a viable solution for developers using Webstorm.
I'm not clear what this means? It's not viable to not commit a file? What about people using sublime text, vs code, etc? Edit: I re-read and I think I know what you mean now. Your company wants you to commit these files so you can't add a global ignore. My only suggestion there would be to git add
explicitly when you git commit
instead of doing a git add .
, I don't know of a git client that forces you to commit everything by default (IIRC even git commit -a
is just for modified files, not new files).
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.
Typically open source avoids having every contributor adding their custom editor configurations
yes, that is correct, but in my opinion it is better to add a comprehensive .gitignore
. This contains the recommended global ignore rules. This is especially useful in open source projects since there is no common global .gitignore
. And there is no way to specify a global .gitignore
for public open source project.
The easiest way to do that is add your own global .gitignore file locally, which you can do once instead of for every project you contribute to. GitHub has a tutorial here.
The problem is that I can't do that. This would lead to the problem that if I am working on a project that requires some webstorm configurations to be committed. The webstorm configuration files are not tracked by Git.
Edit: for your edit @blakeembrey
My only suggestion there would be to git add explicitly when you git commit instead of doing a git add.
yes, that is my workaround.
At the end of the day, this change was just a suggestion. I will remove these changes and watch out when committing
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.
I think you can add !.idea
to the .gitignore
of your company projects, to have them explicitly opt into those folders/files
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.
I think this would not work. Some of the files and folders in the .idea
folder should be ignored. I don't know in detail how the modifier !
works with ignore in subfolders.
!.idea/
.idea/workspace.xml
Would this .gitignore
ignore the file .idea/workspace.xml
?
This would also be quite a time consuming task. All our dozens of projects would have to be updated, the dozens of template projects and the documentation.
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.
I think it would respect the order in which its given, but can't say for certain.
But yeah, I understand your pain, have encountered similar situations in the past :/
I have to create a new pull request. a few weeks ago I deleted some of my github repositories. So I had to create a new pull request. |
If the --json flag is used the missing and unused dependencies are printed as json object