question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add simplified Github Issue/PR URL recognition

See original GitHub issue

Now that we can click on URLs and files we could improve a bit on this and add recognition for a simplified version of github issues and pull requests.

I often use Spyder to develop spyder so this would be really handy, as I often see myself opening a browser tab and opening the referenced issue on sections of code.

Option 1

Simply include full urls to issues on our code base so we can click on them on the spot

Pros: No need to change code, just update the references Cons: Long urls might crop up in the docstrings and comments

# See: https://github.com/spyder-ide/spyder/issues/NNNN
'''See: https://github.com/spyder-ide/spyder/issues/NNNN'''

Option 2

Add a shorthand syntax for github issues and PRs that makes life easy for us.

Pros: Shorter “links” Cons: we need to update the code a bit + update the references

# See issue spyder-ide/spyder#NNNN
# See PR spyder-ide/spyder#NNNN
'''See PR spyder-ide/spyder#NNNN'''

This syntax would apply to both issues and PRs, since they are the “same” on github


What do you think @spyder-ide/core-developers ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
goanpecacommented, May 29, 2019

I also prefer option 2, but it is not me who is going to implement it 😄

@jitseniesen The basic machinery is already implemented so, it is just a matter of deciding a format regex and adding a couple of lines of code.


@bcolsen interesting!

Option 3++

# See issue gh:spyder-ide/spyder#NNNN`
# See PR gh:spyder-ide/spyder#NNNN
'''See PR gh:spyder-ide/spyder#NNNN'''

And optional, so we give priority to github if not found

Something like (needs further thinking!)

r'((?:\w\w:)?[\w\-_]*/[\w\-_]*#[\d]*)'

Would match either of these

hello gh:spyder-ide/spyder#1245 hello
hello gl:spyder-ide/spyder#567 hello 
hello bb:spyder-ide/spyder#8995 hello 
hello spyder-ide/spyder#8995 hello   # Default to github

gh -> github gl: gitlab bb: bitbucket

1reaction
ccordoba12commented, May 30, 2019

Eventually, we can perhaps add a project option so that we can leave out the spyder-ide/spyder and just write issue #9463 in the code

I agree with this, it’d be really nice!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autolinked references and URLs - GitHub Docs
References to URLs, issues, pull requests, and commits are automatically shortened and converted into links.
Read more >
Linking a pull request to an issue - GitHub Docs
You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit...
Read more >
aminya/github-extras: Browser extension adds many useful ...
Linkifies issue/PR references and URLs in code ... Replaces the labels of some simple buttons on repository filelists with icons, making them take...
Read more >
refined-github/refined-github
octocat: Browser extension that simplifies the GitHub interface and adds useful ... Linkifies issue/PR references and URLs in code and conversation titles.
Read more >
Creating a permanent link to a code snippet - GitHub Docs
On GitHub.com, navigate to the main page of the repository. Locate the code you'd like to link to: To link to code from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found