Skip to content

fix(inventory): emit the SPDX header from the generator - #399

Merged
David-Noble-at-work merged 1 commit into
developfrom
fix/inventory-generator-header
Aug 13, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
fix/inventory-generator-header

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Issue #396. make generate runs devlore-inventory under every build and test, and the generator emitted no header — so every make invocation rewrote both inventory.gen.go files 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.

writeInventory now emits the SPDX + copyright lines itself, matching the repository convention exactly so star lint copyright accepts regenerated output unchanged. Same defect class and remedy as the defaultGolangciConfig template #389 already fixed.

Proven by regeneration: make generate now produces output byte-identical to the committed files — the strip-restore cycle is dead. The committed .gen.go files need no change here.

Verified: make vet, make lint-all, full make test green; gofmt clean.

Closes #396

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
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 13, 2026
@David-Noble-at-work
David-Noble-at-work merged commit fdfa8c0 into develop Aug 13, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/inventory-generator-header branch August 13, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

devlore-inventory generator strips the Apache SPDX header on every regeneration

1 participant