Merge lp:~jcsackett/launchpad/better-bug-linking-531889 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | j.c.sackett on 2010-12-20 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 12130 | ||||
| Proposed branch: | lp:~jcsackett/launchpad/better-bug-linking-531889 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
93 lines (+41/-5) 3 files modified
lib/lp/app/browser/stringformatter.py (+4/-2) lib/lp/app/browser/tests/test_stringformatter.py (+35/-1) lib/lp/app/doc/displaying-paragraphs-of-text.txt (+2/-2) |
||||
| To merge this branch: | bzr merge lp:~jcsackett/launchpad/better-bug-linking-531889 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Leonard Richardson (community) | 2010-12-17 | Approve on 2010-12-20 | |
|
Review via email:
|
|||
Commit Message
[r=leonardr]
Description of the Change
Summary
=======
Bugs are automatically linked based on the appearance of certain strings (bug no <somenumber>, bug #<somenumber, &c). However, some of these combinations are linked even when they're the result of apparent typos. This branch updates the regex to avoid matching on these patterns.
Implementation
==============
The bug pattern group in the _re_linkify regex is slightly modified to deal with an appropriate amount of spacing and not match the the phrase "bug number" at the end of a sentence.
Tests
=====
bin/test -t LinkifyingBugs
Lint
====
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
./lib/lp/
408: E501 line too long (88 characters)
412: E501 line too long (86 characters)
408: Line exceeds 78 characters.
412: Line exceeds 78 characters.
E501s are from long sections of the primary linking regex, which may be even harder to read if those lines are wrapped.

You left the ? in the "number?" part of your regular expressions, which will make "bug numbe 10" match when it shouldn't. Take that out and it looks good.