Commit 28526ca
committed
Report the full match for the OAuth 2.0 rule
The self-match reported in issue #41 ("Use 'OAuth 2.0' instead of
'OAuth 2.0'") was fixed upstream in fec6b34, but that fix left the
alternatives shortest-first. Regex alternation takes the first branch
that matches, so "OAuth 2" matched only the bare "OAuth" alternative and
the alert read "Use 'OAuth 2.0' instead of 'OAuth'" — applying which
gives "OAuth 2.0 2".
Ordering the alternatives longest-first makes each variant report the
span it actually means. The inline (?i) is dropped as redundant: the rule
sets ignorecase.
Fixtures now cover OAuth 2.0 as a negative and OAuth 2, OAuth2,
OAuth2.0, and Oauth as positives.1 parent e3d36a4 commit 28526ca
3 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments