Commit 49c11fe
fix(copyright): detect open-ended year ranges ending in "now" (#1222)
A copyright line whose year range ends in "now" (e.g.
"Copyright (c) 2013-NOW Jinzhu <wosmvp@gmail.com>") was dropped
entirely: the "2013-NOW" token failed every year pattern and tagged
as a common noun, so the grammar never built a copyright tree.
Extend the existing year-dash-present POS pattern (derived from
ScanCode's _YEAR_DASH_PRESENT) to also accept "now", matched
case-insensitively since it is commonly uppercase in the wild. The
match stays anchored to a year in the same token, so standalone
"now" and unrelated attached tokens like "2013-final" are not
treated as years.
Refs aboutcode-org/scancode-toolkit#5220
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8fa9874 commit 49c11fe
3 files changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
84 | 106 | | |
85 | 107 | | |
86 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
| |||
0 commit comments