Improve license linting

* Bump max year to $now + 1.
* Emit a more specific error for year range where a single year is expected.
This commit is contained in:
Richard Gibson 2025-04-04 12:31:09 -04:00
parent 2f937a61fd
commit cf4c281a38

View File

@ -1,12 +1,13 @@
import datetime
import re
from ..check import Check
_MIN_YEAR = 2009
_MAX_YEAR = 2030
_MAX_YEAR = datetime.date.today().year + 1
_LICENSE_PATTERN = re.compile(
r'// Copyright( \([C]\))? (\w+) .+\. {1,2}All rights reserved\.[\r\n]{1,2}' +
r'// Copyright( \(C\))? ([1-9][0-9-]*) .+\. {1,2}All rights reserved\.[\r\n]{1,2}' +
r'(' +
r'// This code is governed by the( BSD)? license found in the LICENSE file\.' +
r'|' +