diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-08 04:51:25 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-08 04:51:25 +0700 |
| commit | 496c812f6e14b77408b71f7a35a3d755b8bbbf36 (patch) | |
| tree | d12b51bcb11eaffab5a1dda8e044d3298390c4f5 /file.go | |
| parent | 2f6ebacaea7851be5c17a970514769dd3e9735e9 (diff) | |
| download | spdxconv-496c812f6e14b77408b71f7a35a3d755b8bbbf36.tar.xz | |
all: add missing license and copyright
Ah, the irony.
Diffstat (limited to 'file.go')
| -rw-r--r-- | file.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -11,10 +11,14 @@ import ( "slices" ) +// REUSE-IgnoreStart + // reLicenseID regex to detect SPDX license identifier with or without // comment prefix. var reLicenseID = regexp.MustCompile(`^(//+|#+|/\*+|<!--+)?\s?SPDX-License-Identifier:.*$`) +// REUSE-IgnoreEnd + type file struct { path string @@ -147,8 +151,10 @@ func (f *file) applyLicenseID(conv *SPDXConv) { if licenseID == `` { licenseID = conv.cfg.LicenseIdentifier } + // REUSE-IgnoreStart line := fmt.Sprintf("%sSPDX-License-Identifier: %s%s", f.commentPrefix, licenseID, f.commentSuffix) + // REUSE-IgnoreEnd f.insertLicenseID([]byte(line)) } |
