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. --- config.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config.go') diff --git a/config.go b/config.go index ad5df48..e968fd4 100644 --- a/config.go +++ b/config.go @@ -14,6 +14,7 @@ var configTemplate string = `# SPDX-License-Identifier: CC0-1.0 [default] license_identifier = +copyright_year = file_copyright_text = max_line_match = 10 @@ -63,6 +64,7 @@ pattern = "^(//+|#+)\\s+Copyright\\s+(?\\d{4}),?\\s+(?.*)\\s+<*(?< type config struct { LicenseIdentifier string `ini:"default::license_identifier"` + CopyrightYear string `ini:"default::copyright_year"` FileCopyrightText string `ini:"default::file_copyright_text"` MatchFileComment []*matchFileComment `ini:"match-file-comment"` -- cgit v1.3