File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ The config file has the following sections:
55
55
* [ golangciLint] ( #golangcilint )
56
56
* [ goReleaser] ( #goreleaser )
57
57
* [ makefile] ( #makefile )
58
+ * [ reuse] ( #reuse )
58
59
* [ metadata] ( #metadata )
59
60
* [ renovate] ( #renovate )
60
61
* [ spellCheck] ( #spellcheck )
@@ -235,6 +236,18 @@ makefile:
235
236
` enabled` is an optional setting to disable the `Makefile` generation completely.
236
237
If not specified, the setting is treated as being set to true to maintain backwards compatibility with older configs.
237
238
239
+ # ## `reuse`
240
+
241
+ ` ` ` yaml
242
+ reuse:
243
+ enabled: false
244
+ ` ` `
245
+
246
+ ` reuse` contains settings related to the [REUSE](https://reuse.software/) config generation.
247
+
248
+ ` enabled` is an optional setting to disable the REUSE config generation completely.
249
+ If not specified, the setting is treated as being set to true to maintain backwards compatibility with older configs.
250
+
238
251
# ## `metadata`
239
252
240
253
` ` ` yaml
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ type Configuration struct {
39
39
Renovate RenovateConfig `yaml:"renovate"`
40
40
SpellCheck SpellCheckConfiguration `yaml:"spellCheck"`
41
41
Test TestConfiguration `yaml:"testPackages"`
42
+ Reuse ReuseConfiguration `yaml:"reuse"`
42
43
Verbatim string `yaml:"verbatim"`
43
44
VariableValues map [string ]string `yaml:"variables"`
44
45
}
@@ -69,6 +70,11 @@ type TestConfiguration struct {
69
70
Except string `yaml:"except"`
70
71
}
71
72
73
+ // ReuseConfiguration appears in type Configuration.
74
+ type ReuseConfiguration struct {
75
+ Enabled * bool `yaml:"enabled"`
76
+ }
77
+
72
78
// CoverageConfiguration appears in type Configuration.
73
79
type CoverageConfiguration struct {
74
80
Only string `yaml:"only"`
Original file line number Diff line number Diff line change @@ -427,8 +427,13 @@ endif
427
427
})
428
428
429
429
if isGolang {
430
- reuseConfigFile := "REUSE.toml"
431
- must .Succeed (os .WriteFile (reuseConfigFile , reuseConfig , 0o666 ))
430
+ // If disabled, the REUSE.toml file should not be overridden.
431
+ // This is useful if the project needs additional information in
432
+ // the REUSE.toml file, e.g., specific disclaimers.
433
+ if cfg .Reuse .Enabled == nil || * cfg .Reuse .Enabled {
434
+ reuseConfigFile := "REUSE.toml"
435
+ must .Succeed (os .WriteFile (reuseConfigFile , reuseConfig , 0o666 ))
436
+ }
432
437
433
438
licenseRulesFile := ".license-scan-rules.json"
434
439
must .Succeed (os .WriteFile (licenseRulesFile , licenseRules , 0o666 ))
You can’t perform that action at this time.
0 commit comments