Commit e1f7ba6
authored
chore(lint): stamp license headers with the current year (#246)
## Summary
### Why?
The license-header linter pinned the copyright year to a hardcoded
`2025` constant and required an exact match, so any file authored in a
later year would need a manual constant bump — and bumping it would
retroactively fail every existing file.
### What?
The header is now validated by pattern: the copyright line matches `//
Copyright (c) <YYYY> Uber Technologies, Inc.` for any 4-digit year,
while the rest of the block must match exactly. The `-fix` mode stamps
`time.Now().Year()`, so new files get the current year automatically
with no future edits. Existing files (all `2025`) keep passing. Added
test cases covering an older year, a wrong company, and a non-numeric
year.
## Test Plan
✅ `bazel test //tool/linter/licenseheader:licenseheader_test`
✅ `bazel run //tool/linter/licenseheader -- -check` (whole repo still
clean)1 parent c4fa997 commit e1f7ba6
2 files changed
Lines changed: 61 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
26 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
39 | 58 | | |
40 | 59 | | |
41 | 60 | | |
| |||
156 | 175 | | |
157 | 176 | | |
158 | 177 | | |
| 178 | + | |
159 | 179 | | |
160 | 180 | | |
161 | 181 | | |
| |||
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
174 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
175 | 202 | | |
176 | 203 | | |
177 | | - | |
178 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
179 | 207 | | |
180 | 208 | | |
181 | 209 | | |
182 | 210 | | |
183 | 211 | | |
184 | 212 | | |
185 | 213 | | |
| 214 | + | |
| 215 | + | |
186 | 216 | | |
187 | 217 | | |
188 | 218 | | |
189 | 219 | | |
190 | 220 | | |
191 | 221 | | |
192 | | - | |
| 222 | + | |
193 | 223 | | |
194 | | - | |
| 224 | + | |
195 | 225 | | |
196 | 226 | | |
197 | | - | |
| 227 | + | |
198 | 228 | | |
199 | 229 | | |
200 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | | - | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
74 | 92 | | |
75 | 93 | | |
76 | 94 | | |
| |||
96 | 114 | | |
97 | 115 | | |
98 | 116 | | |
99 | | - | |
| 117 | + | |
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
| |||
112 | 130 | | |
113 | 131 | | |
114 | 132 | | |
115 | | - | |
| 133 | + | |
116 | 134 | | |
117 | 135 | | |
118 | 136 | | |
| |||
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
161 | | - | |
| 179 | + | |
162 | 180 | | |
163 | 181 | | |
164 | 182 | | |
| |||
0 commit comments