-
Notifications
You must be signed in to change notification settings - Fork 19
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
JSON reporting or summary line #119
Comments
Thanks for the suggestion, sure, this sounds like something we can add. It will be fairly output to add a line to the logging, similar to black, that says
I will work on this in the upcoming days. Would this suffice for your purposes? Alternatively/additionally, we could add a json file, this will be slightly more work. For example, the output json file could look something like this:
|
Yes, looks pretty much perfect. |
Hi @WTK , sorry, I just updated my comment. Should maybe have added a new one instead. Could you let me know if just the additional logging output would suffice, or if the json file is needed? |
No worries :) As for the summary line, I'd suggest adding a tiny bit more details. Like "There were X dependency issues found: Y obsolete, Z missing, W transitive". |
I'm thinking of adding this code in the upcoming release:
However, I do have a strong preference to not add the details you mentioned to the output in that line, since it feels a bit redundant. The issues are outlined right below it.
So if the above logging line is not sufficient and you'd like to have the number of issues per category, I'd prefer to work on adding a CLI argument that can be used to specify a path for a json file with the details. Let me know your thoughts :) |
They're outlined in the response indeed, but it's not a one-liner you can just take a look to understand what are we dealing with. That said, I'm not pushing for it :) |
I do understand that the logging output is not very useful to get numbers of different types of issues from, that would become too much of a hassle and prone to errors. However, if you are okay with it I'll choose not to add details about the number of different issues to the summary line. I think those are more suited to be fetched from a json file. So if you need those, just give me a heads up and I'll work on that. side-note; since this is an open-source project I don't think that my preference should be a deciding factor in these kind of decisions. So if there are more people in favour of expanding the summary line than adding json output, then that should be the way to go. |
Thanks for considering this! I just came here today to see if this was an upcoming feature. We want to use this in python pre-commit tool and the json will be helpful to make a wrapper around it. |
Thanks for letting me know this is a feature you also need, I'll work on adding json output. |
@rrauenza I just created a PR that allows the user to run deptry as
where an example of the resulting
Would this suffice for your purposes? |
Is your feature request related to a problem? Please describe.
It's related to using deptry in CI (particularly Jenkins)
Describe the solution you would like
It would make it easier to integrate deptry into CI pipelines if you'd offert json output and/or some summary line that can be easily regexped to find out number of issues found.
Additional context
Jenkins allows us to define scripts that are used to parse output of various tools and collect errors/warnings. For example we use it to parse output from
black
formatter check, that after bunch of text spits out line like "2 files would be modified.". So we parse that and report that black found 2 issues.The text was updated successfully, but these errors were encountered: