Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

feat: add cli flag --json #145

Closed
wants to merge 1 commit into from
Closed

feat: add cli flag --json #145

wants to merge 1 commit into from

Conversation

mmuenker
Copy link
Contributor

If the --json flag is used the missing and unused dependencies are printed as json object

{
  "missing": [],
  "unused": []
}

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>
Copy link
Collaborator

@voxpelli voxpelli left a 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)
Copy link
Collaborator

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

Copy link
Contributor Author

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
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

@blakeembrey blakeembrey Jun 30, 2021

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).

Copy link
Contributor Author

@mmuenker mmuenker Jun 30, 2021

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

Copy link
Collaborator

@voxpelli voxpelli Jun 30, 2021

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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 :/

@mmuenker
Copy link
Contributor Author

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.

@mmuenker mmuenker closed this Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants