Repository navigation
fix(inventory): emit the SPDX header from the generator - #399
Merged
Merged
Conversation
Issue #396. The relicense (#389) stamped Apache-2.0 headers onto the two inventory.gen.go files, but make generate runs the generator under every build and test, and the generator did not emit a header — so any make invocation rewrote both files headerless, and the next commit that staged them would have silently undone the relicense on those files. Observed in practice minutes after #389 merged, and twice more since: every local build left both files modified with exactly the header lines deleted, repaired by hand each time. writeInventory now emits the SPDX and copyright lines itself, matching the repository convention exactly so star lint copyright accepts regenerated output unchanged. Same defect class, same remedy as the defaultGolangciConfig template #389 already fixed: a generator whose output must carry the header emits it from the template rather than relying on a one-time sweep. Proven by regeneration: make generate now produces output byte-identical to the committed files — the strip-restore cycle is dead. The committed inventory.gen.go files need no change in this commit. Verified: make vet, make lint-all, full make test green — zero FAIL or panic lines by count; gofmt clean. Issue: #396
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #396.
make generaterunsdevlore-inventoryunder every build and test, and the generator emitted no header — so everymakeinvocation rewrote bothinventory.gen.gofiles headerless, silently undoing the relicense (#389) on them the next time they were staged. Observed three times since #389 merged, repaired by hand each time.writeInventorynow emits the SPDX + copyright lines itself, matching the repository convention exactly sostar lint copyrightaccepts regenerated output unchanged. Same defect class and remedy as thedefaultGolangciConfigtemplate #389 already fixed.Proven by regeneration:
make generatenow produces output byte-identical to the committed files — the strip-restore cycle is dead. The committed.gen.gofiles need no change here.Verified:
make vet,make lint-all, fullmake testgreen; gofmt clean.Closes #396