xchwan commented on code in PR #67146:
URL: https://github.com/apache/airflow/pull/67146#discussion_r3389411411
##########
scripts/ci/prek/check_notice_files.py:
##########
@@ -20,31 +20,30 @@
# dependencies = []
# ///
"""
-Check that NOTICE files contain the current year and Apache Software
Foundation reference.
+Check that NOTICE files contain the Apache Software Foundation reference.
-This script validates NOTICE files to ensure they:
-- Include the current year in copyright statements
-- Reference the Apache Software Foundation
+This script validates NOTICE files to ensure they reference the Apache
Software Foundation.
+The copyright year is intentionally not checked here to avoid CI failures at
the start of
+a new year. Year updates should be performed manually by the release manager
using
+``prek run update-notice-year --all-files`` before the first release of each
new year.
Usage: check_notice_files.py <notice_file_paths...>
"""
from __future__ import annotations
import sys
-from datetime import datetime
from pathlib import Path
-CURRENT_YEAR = str(datetime.now().year)
+ASF_DECLARATION = "The Apache Software Foundation"
errors = 0
for notice_file in sys.argv[1:]:
content = Path(notice_file).read_text()
- expected = f"Copyright 2016-{CURRENT_YEAR} The Apache Software Foundation"
- if "Copyright" in content and expected not in content:
- print(f"❌ {notice_file}: Missing expected string: {expected!r}")
+ if ASF_DECLARATION not in content:
+ print(f"❌ {notice_file}: Missing expected string: {ASF_DECLARATION!r}")
errors += 1
sys.exit(1 if errors else 0)
Review Comment:
modify done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]