Skip to content
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

Create "markdown" output printer #133

Open
estahn opened this issue Jul 20, 2023 · 4 comments
Open

Create "markdown" output printer #133

estahn opened this issue Jul 20, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@estahn
Copy link

estahn commented Jul 20, 2023

I'm using the output to be appended as a PR comment, hence proper formatting as markdown would be ideal. Possibly more formats would be useful for others to do post-processing.

Formats I think could be useful: text (current), json, markdown, github-markdown

Something like this:

image

@MiWeiss
Copy link
Collaborator

MiWeiss commented Jul 21, 2023

Thanks @estahn for opening the PR.

This is definitely something we'd like to support, and also something we have forseen for a while. However, doing this properly may cost quite some time and I don't have that time to spare at the moment ;-)

However, there's already quite some preparation done for this functionality. The printer.py file contains a class which is used for printing the results to the command line. See https://github.com/HunterMcGushion/docstr_coverage/blob/master/docstr_coverage/printers.py. Our long term plan is to extract an abstract superclass from this class and to provide multiple exporters (e.g. JSON file, Markdown printout, ...).

Would you be interested in contributing this feature, i.e., in writing a markdown printer? @HunterMcGushion and I would of course be happy to help/assist and review whenever needed.

@MiWeiss MiWeiss changed the title Output format "markdown" Create "markdown" output printer Jul 21, 2023
@MiWeiss MiWeiss added enhancement New feature or request help wanted Extra attention is needed labels Jul 21, 2023
@estahn
Copy link
Author

estahn commented Jul 21, 2023

@MiWeiss Yes, I already started on something. Just curious why you use logger.info to print out the text.

@MiWeiss
Copy link
Collaborator

MiWeiss commented Jul 21, 2023

Puh, if I recall correctly this was an open todo long before I joined the project which was then implemented along some refactoring.

I can only assume that the reason was to facilitate output configuration. But afaik, this is not really used by any of our users; it's not something we documented, nor something for which I'd see a particuarly obvious use case.

Thus, if it facilitates your contribution, I'd be happy to switch back to print(). Of course, @HunterMcGushion will have his veto right, thus it would probably be best to submit that change in a separate PR.

@skv0zsneg
Copy link

skv0zsneg commented Feb 1, 2024

Hi! Is this issue still in developing?

In my working cases I use get_docstring_coverage to put coverage information on reStructuredText pages throw Sphinx. But it forced me to use some non beautiful hacks. I think that just by adding some flag like print_output in arguments of this function and to argparse for creating coverage report in files with reStructuredText or Mardown format will be great feature!

If you liked this idea I will do it with pleasure😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants