From a35e19e6cff5878ca0384f9a8da98b112429c45c Mon Sep 17 00:00:00 2001 From: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> Date: Mon, 5 Jan 2026 11:00:44 +0100 Subject: [PATCH] Makefile.common: Add check for future copyright years Add validation in common-check_license to detect and reject copyright headers with years 2026 or later. This enforces the removal of copyright dates as per https://github.com/prometheus/proposals/blob/main/proposals/0050-remove-copyright-dates.md Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> --- Makefile.common | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.common b/Makefile.common index 998da23093..f70443272f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -129,6 +129,12 @@ common-check_license: echo "license header checking failed:"; echo "$${licRes}"; \ exit 1; \ fi + @echo ">> checking for copyright years 2026 or later" + @futureYearRes=$$(git grep -E 'Copyright (202[6-9]|20[3-9][0-9])' -- '*.go' ':!:vendor/*' || true); \ + if [ -n "$${futureYearRes}" ]; then \ + echo "Files with copyright year 2026 or later found (should use 'Copyright The Prometheus Authors'):"; echo "$${futureYearRes}"; \ + exit 1; \ + fi .PHONY: common-deps common-deps: