aboutsummaryrefslogtreecommitdiff
path: root/file.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 /file.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 'file.go')
-rw-r--r--file.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/file.go b/file.go
index 4e8d565..7849d9e 100644
--- a/file.go
+++ b/file.go
@@ -240,8 +240,9 @@ func (f *file) apply(conv *SPDXConv) (err error) {
f.topLines = slices.Insert(f.topLines, f.idxLicenseID, rawline)
if f.copyrightYear == valUnknown {
- f.copyrightYear = ``
- } else {
+ f.copyrightYear = conv.cfg.CopyrightYear
+ }
+ if f.copyrightYear != `` {
f.copyrightYear += ` `
}
// REUSE-IgnoreStart