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

Support compare diff URLs in prevent-pr-commit-link-loss #3528

Closed
fregante opened this issue Sep 4, 2020 · 6 comments · Fixed by #3583
Closed

Support compare diff URLs in prevent-pr-commit-link-loss #3528

fregante opened this issue Sep 4, 2020 · 6 comments · Fixed by #3583

Comments

@fregante
Copy link
Member

fregante commented Sep 4, 2020

Copy-paste this URL in a comment a click "Preview"

https://github.com/sindresorhus/got/compare/v11.5.2...v11.6.0#diff-6be2971b2bb8dbf48d15ff680dd898b0R191

GitHub changes the URL to the following, breaking it

https://github.com/sindresorhus/got/compare/v11.5.2...v11.6.0diff-6be2971b2bb8dbf48d15ff680dd898b0R191

This is a similar GitHub bug to #2327, which was fixed by #3085 (prevent-pr-commit-link-loss), so it'd make sense to extend that feature

@esakki-selvaraj
Copy link
Contributor

can I work on this issue?

@yakov116
Copy link
Member

@esakki-selvaraj go for it!

@esakki-selvaraj
Copy link
Contributor

@yakov116 Can i get some more links so that I can check my Reg Expression!

@yakov116
Copy link
Member

@fregante
Copy link
Member Author

fregante commented Sep 18, 2020

Keep in mind that there's a pretty advanced regex (which avoids selecting the url twice) already set up:

https://github.com/sindresorhus/refined-github/blob/6d339762d762b669bb48b2977f40a83c48305a2d/source/github-helpers/index.ts#L98-L99

And tested:

https://github.com/sindresorhus/refined-github/blob/86529e79015ea54b2eda9f06a1aca692acf7baea/test/helpers.ts#L176-L211

You should start from that regex: copy the regex, copy the tests (changing only the URLs) and make sure they pass.

@esakki-selvaraj
Copy link
Contributor

esakki-selvaraj commented Sep 19, 2020

it's working

@fregante fregante changed the title Support compare diff URLs to prevent-pr-commit-link-loss Support compare diff URLs in prevent-pr-commit-link-loss Sep 20, 2020
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.

3 participants