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

CommitBear: Check proper use of https when referencing issues for GitHub #2683

Closed
li-boxuan opened this issue Sep 1, 2018 · 3 comments · Fixed by #2755
Closed

CommitBear: Check proper use of https when referencing issues for GitHub #2683

li-boxuan opened this issue Sep 1, 2018 · 3 comments · Fixed by #2755

Comments

@li-boxuan
Copy link
Member

https://github.com/coala/coala-bears/blob/master/bears/vcs/CommitBear.py#L360 matches links and tags, e.g. fix #123, fix https://github.com

This would also pass the test Closes http://github.com. However, this would not trigger GitHub autolinked reference feature. The commit message should be Closes https://github.com instead.

For those who are not familiar with autolinked reference feature, I did a simple experiment. I created an issue first li-boxuan/github-playground#1

Then I create a pr, aiming to close that issue. See commit message https://github.com/li-boxuan/github-playground/pull/2/commits. However, after this pr gets merged, it doesn't close the corresponding issue automatically.

Finally, this pr https://github.com/li-boxuan/github-playground/pull/3/commits closes the corresponding issue automatically when it's merged. Check commit messages carefully to see the difference.

That means we should check proper usage of https, at least for GitHub. Not sure if GitLab has similar features.

@jayvdb jayvdb changed the title CommitBear: Check proper use of https when referencing issues CommitBear: Check proper use of https when referencing issues for GitHub Oct 21, 2018
@RazvanMitrica
Copy link

Couldn't this be solved by deleting the '?' character after the 's' in 'https' here: https://github.com/coala/coala-bears/blob/master/bears/vcs/CommitBear.py#L28 ? Since github will autolink only for https in the full issue, the 's' is mandatory. Also, as a completion we could mention the host on this yield as well: https://github.com/coala/coala-bears/blob/master/bears/vcs/CommitBear.py#L389 just to make the developer aware of the host the problem is related to. If I am talking nonsense, please give me some advice.

@li-boxuan
Copy link
Member Author

@RazvanMitrica Sounds good. This issue is reserved for GCI students though :)

@jayvdb
Copy link
Member

jayvdb commented Nov 11, 2018

This issue reserved for Google Code-in task 4719605319729152.

ZamaSharik pushed a commit to ZamaSharik/coala-bears that referenced this issue Nov 15, 2018
Check if commit message uses 'https' rather than 'http' to automatically
close the referenced issue for GitHub and GitLab. Error message now
includes host.

Closes coala#2683
Closes coala#2722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants