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

Accept punctuation after simple+cross repository issue references #10091

Merged
merged 7 commits into from
Feb 1, 2020

Conversation

guillep2k
Copy link
Member

@guillep2k guillep2k commented Feb 1, 2020

This PR adds ,, ; and : as valid characters following a simple issue or PR ref, as long as there's a spacing character following:

#123 was supported.
#123. was supported.
#123, was not supported, now it is.
#123; was not supported, now it is.
#123: was not supported, now it is.
#123.456 is not supported.

Attempts to close (?) #10074, but I've left a few cases out; I feel a little uncomfortable trying to read too much out of the text with just a regexp, I don't want to start getting too many false positives:

  • I didn't add question or exclamation marks... Seems excesive? I think exclamation marks look weird in the case of PRs (Look at !1234!) but it may work with issues (Look at #1234!).
  • I did this only for simple and cross repository references, not external alphanumeric (AAAA-1234) references.

Fixes #10074

@codecov-io
Copy link

codecov-io commented Feb 1, 2020

Codecov Report

Merging #10091 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10091      +/-   ##
==========================================
- Coverage   43.48%   43.45%   -0.03%     
==========================================
  Files         566      566              
  Lines       79024    79024              
==========================================
- Hits        34366    34343      -23     
- Misses      40421    40441      +20     
- Partials     4237     4240       +3
Impacted Files Coverage Δ
services/pull/patch.go 66.03% <0%> (-3.78%) ⬇️
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
modules/queue/workerpool.go 46.61% <0%> (-2.5%) ⬇️
models/unit.go 37.03% <0%> (-2.47%) ⬇️
modules/log/file.go 75.52% <0%> (-2.1%) ⬇️
routers/repo/view.go 38.59% <0%> (-0.88%) ⬇️
models/repo.go 51.33% <0%> (-0.14%) ⬇️
services/pull/pull.go 34.23% <0%> (+0.3%) ⬆️
modules/queue/manager.go 62.05% <0%> (+1.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3606ee...5535773. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 1, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 1, 2020
@6543
Copy link
Member

6543 commented Feb 1, 2020

i think it close #10074

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 1, 2020
@lunny
Copy link
Member

lunny commented Feb 1, 2020

And ? and !?

Can ? and ! be supported as well? I think if the rule is the same (space or EOL immediately after) then it isn't ambiguous, but I can say nothing about the troubles to implement that.

@guillep2k
Copy link
Member Author

And ? and !?

No problem, I can add those.

@zeripath zeripath added type/bug type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Feb 1, 2020
@zeripath zeripath added this to the 1.12.0 milestone Feb 1, 2020
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per above awaiting addition of ? and !

@guillep2k
Copy link
Member Author

Added ! and ?. Fixed a bug where mentions/references were not detected if they were consecutive and shared a space:

......._REF1_REF2_.....
.......XXXXXX..........
............YYYYYY.....

This was not apparent in markdown rendering because the function takes them one by one.

@guillep2k
Copy link
Member Author

And ? and !?

@lunny done.

@zeripath zeripath merged commit 131baa2 into go-gitea:master Feb 1, 2020
@guillep2k guillep2k deleted the issue-comma branch February 1, 2020 18:08
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross reference doesn't render as a link if followed by punctuation signs (colon, semicolon, question, ...)
6 participants