aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-12 20:50:38 +0700
committerShulhan <ms@kilabit.info>2026-01-12 21:23:12 +0700
commit9817757f8dca159aa261315a91fceff1d9a13566 (patch)
treedd9ce0b3913e187b447c55518a01387fc059009d /config.go
parentbf35b0b8ab23f07c491e1c6b97c90b772942b7b7 (diff)
downloadspdxconv-9817757f8dca159aa261315a91fceff1d9a13566.tar.xz
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.
Diffstat (limited to 'config.go')
-rw-r--r--config.go2
1 files changed, 2 insertions, 0 deletions
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+(?<year>\\d{4}),?\\s+(?<author>.*)\\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"`