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

Feature Request: Flag for alternative formatting of line number output #22

Open
1 of 2 tasks
hectormz opened this issue May 12, 2020 · 2 comments
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@hectormz
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:

  • bug
  • feature

Description of Bug or Feature

I'm using interrogate a lot right now to go through projects and add missing docstrings (- vv flag mostly). VS Code (and other IDEs?) can convert the path to a file in the output as a link, so I can click to a file missing docstrings (technically with output from interrogate, I believe it's actually searching for the file. In my case, if the paths included another level or two, it would be a be proper link). If the path to a file is followed by :line_number, clicking the link jumps to the line of code.

It would be nice to have a flag which would include file_path:line_number in the output for each function found, so a user could jump to the function even faster.

So instead of something like this:

==================== Coverage for /Users/lynn/dev/interrogate/ ======================
--------------------------------- Detailed Coverage ---------------------------------
| Name                                                                  |    Status |
|-----------------------------------------------------------------------|-----------|
| tests/unit/__init__.py (module)                                       |   COVERED |
|-----------------------------------------------------------------------|-----------|
| tests/unit/test_badge_gen.py (module)                                 |   COVERED |
|   test_save_badge (L14)                                               |   COVERED |
|   test_get_badge (L35)                                                |   COVERED |
|   test_get_color (L44)                                                |   COVERED |
|   test_create (L61)                                                   |   COVERED |
|-----------------------------------------------------------------------|-----------|

The user could ask for this type of output

==================== Coverage for /Users/lynn/dev/interrogate/ ======================
--------------------------------- Detailed Coverage ---------------------------------
| Name                                                                  |    Status |
|-----------------------------------------------------------------------|-----------|
| tests/unit/__init__.py (module)                                       |   COVERED |
|-----------------------------------------------------------------------|-----------|
| tests/unit/test_badge_gen.py (module)                                 |   COVERED |
|   test_save_badge                                                     |   COVERED |
|       tests/unit/test_badge_gen.py:14                                 |           |
|   test_get_badge                                                      |   COVERED |
|       tests/unit/test_badge_gen.py:35                                 |           |
|   test_get_color                                                      |   COVERED |
|       tests/unit/test_badge_gen.py:44                                 |           |
|   test_create                                                         |   COVERED |
|       tests/unit/test_badge_gen.py:61                                 |           |
|-----------------------------------------------------------------------|-----------|

I'm not sure the best way to format it all, and it would be "messier", but would make it really easy to jump through these functions. I mostly use VS Code, but I'm not sure if other IDEs have similar linking.

@econchick
Copy link
Owner

Interesting - I can see how this would be helpful. Let me give it some thought!

@econchick econchick added the enhancement New feature or request label May 12, 2020
@hectormz
Copy link
Author

Sure thing @econchick . Just putting it on your radar. It helps in my case, but I'm not sure if it fits in your broader plan.

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

No branches or pull requests

2 participants