From 9817757f8dca159aa261315a91fceff1d9a13566 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 12 Jan 2026 20:50:38 +0700 Subject: all: add configuration for setting default copyright year The `copyright_year` set the default year to be used in `SPDX-FileCopyrightText`. The year can be a single year (for example "2026"), range of year (for example, "2000-2026"), or list of year with comma separated (for example, "2000,2001,2026"); as long as there is no space in between. --- testdata/Apply_test.txt | 7 ++++--- testdata/scan/spdxconv.cfg | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'testdata') diff --git a/testdata/Apply_test.txt b/testdata/Apply_test.txt index 43360b4..611f654 100644 --- a/testdata/Apply_test.txt +++ b/testdata/Apply_test.txt @@ -9,6 +9,7 @@ [default] license_identifier = GPL-3.0-only +copyright_year = 2026 file_copyright_text = M. Shulhan [match-file-comment] @@ -61,7 +62,7 @@ pattern = "^(//+|#+)\\s+Copyright\\s+(?\\d{4}),?\\s+(?.*)\\s+<*(?< <<< without_spdx_license_id.go // SPDX-License-Identifier: GPL-3.0-only -// SPDX-FileCopyrightText: M. Shulhan +// SPDX-FileCopyrightText: 2026 M. Shulhan 1 2 @@ -75,7 +76,7 @@ pattern = "^(//+|#+)\\s+Copyright\\s+(?\\d{4}),?\\s+(?.*)\\s+<*(?< <<< with_spdx_at_bottom.go // SPDX-License-Identifier: GPL-3.0-only -// SPDX-FileCopyrightText: M. Shulhan +// SPDX-FileCopyrightText: 2026 M. Shulhan 1 2 @@ -89,7 +90,7 @@ pattern = "^(//+|#+)\\s+Copyright\\s+(?\\d{4}),?\\s+(?.*)\\s+<*(?< <<< with_spdx_license_id_only.go // SPDX-License-Identifier: GPL-3.0-only -// SPDX-FileCopyrightText: M. Shulhan +// SPDX-FileCopyrightText: 2026 M. Shulhan 1 2 diff --git a/testdata/scan/spdxconv.cfg b/testdata/scan/spdxconv.cfg index d317d64..59ae864 100644 --- a/testdata/scan/spdxconv.cfg +++ b/testdata/scan/spdxconv.cfg @@ -3,6 +3,7 @@ [default] license_identifier = GPL-3.0-only +copyright_year = 2026 file_copyright_text = Author max_line_match = 10 -- cgit v1.3-5-g9baa