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

Make filenames clickable #43

Open
sobolevn opened this issue Mar 31, 2019 · 2 comments
Open

Make filenames clickable #43

sobolevn opened this issue Mar 31, 2019 · 2 comments

Comments

@sobolevn
Copy link

Hi, @hanneskaeufler! Thanks for your awesome plugin.
We are using it inside our review pipeline with great success: https://github.com/wemake-services/kira-review

But, I would like to suggest adding a very useful feature: clickable filenames and lines.
When I review current TODOs I have to go inside the code manually, find the correct line, and then go back again.

Снимок экрана 2019-03-31 в 17 07 19

I would like to suggest something like this.

  1. Line #N becomes a clickable link

Снимок экрана 2019-03-31 в 17 17 28

  1. When you click it, browser will open a new tab with the correct branch (the one you review), correct file and line number:

Снимок экрана 2019-03-31 в 17 18 49

As far as I know we can use gitlab.html_link(item) to make full path from filename. It will require some changes to also accept lineno, I guess.

What do you think?
I can help you with that, but I am not a Ruby developer.

@hanneskaeufler
Copy link
Owner

Hi @sobolevn, I am glad you find it useful! That's a very good suggestion you make. I would be happy to enable the plugin do something like that. I might look into it at some point, but please don't hold your breath on me ever implementing it.

I am super happy to help you by reviewing a PR or answering questions though, so please feel free and try to implement it yourself. This is the spot where we construct the todo entries:
https://github.com/hanneskaeufler/danger-todoist/blob/master/lib/todoist/plugin.rb#L99. The Todo class has a file property https://github.com/hanneskaeufler/danger-todoist/blob/master/lib/todoist/todo.rb#L2, so as you said adding a gitlab.html or github.html should not be too hard to achieve. As for adding a line marker, yeah, we could probably make a contribution to danger to allow passing the #LXX to the html method, or go the hacky route and just slap it onto the link ourselves.

Again, thanks for the suggestion!

@sobolevn
Copy link
Author

sobolevn commented Apr 1, 2019

@hanneskaeufler thanks! I will try my best.

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

No branches or pull requests

2 participants