Skip to content

Feat/templates repo immutable - #32

Merged
fredbi merged 5 commits into
go-openapi:masterfrom
fredbi:feat/templates-repo-immutable
Aug 21, 2026
Merged

Feat/templates repo immutable#32
fredbi merged 5 commits into
go-openapi:masterfrom
fredbi:feat/templates-repo-immutable

Conversation

@fredbi

@fredbi fredbi commented Aug 21, 2026

Copy link
Copy Markdown
Member

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

@fredbi
fredbi force-pushed the feat/templates-repo-immutable branch from 3ac9f7a to c7b8ae2 Compare August 21, 2026 10:59
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.01175% with 113 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.96%. Comparing base (3efbfc1) to head (5beb6d4).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
funcmaps/golang/numbers.go 46.55% 31 Missing ⚠️
funcmaps/merge.go 60.00% 16 Missing ⚠️
templates-repo/sources.go 90.76% 12 Missing ⚠️
templates-repo/repository.go 95.52% 9 Missing ⚠️
funcmaps/golang/funcmap.go 81.57% 7 Missing ⚠️
templates-repo/dependencies.go 87.71% 7 Missing ⚠️
templates-repo/internal/cover/instrument.go 91.56% 7 Missing ⚠️
templates-repo/resolve.go 95.65% 5 Missing ⚠️
templates-repo/documentation.go 95.83% 4 Missing ⚠️
templates-repo/internal/document/contract.go 97.51% 4 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   67.06%   75.96%   +8.90%     
==========================================
  Files          31       54      +23     
  Lines        2663     3945    +1282     
==========================================
+ Hits         1786     2997    +1211     
- Misses        843      947     +104     
+ Partials       34        1      -33     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

fredbi added 5 commits August 21, 2026 13:50
* makes dependabot more responsive (twice a week instead of once)
* fixes dependabot PR limit to avoid skipping updates on mono-repos
* bumps go.mod dependencies
* drops the Go Report Card (discontinued service)

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
WithTokenSeparator replaces the whole predicate, so a caller wanting one
extra separator had to restate the default classification.

WithExtraTokenSeparator takes runes and keeps the default: customTokenSeparatorFunc consults
defaultTokenSeparator first, then a set holding only the runes that are not already separators.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Generators assemble a funcmap from several parts and need the overriding
rules spelled out.

Merge is last-wins, Coalesce is first-wins, and both delete the text/template builtins from the result
so no part can shadow "and", "index", "printf" and the rest.

Pick clones a funcmap down to the named functions, ignoring names the source does not hold.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Replaces the mutable Repository (NewRepository, LoadDefaults, LoadDir,
LoadContrib, AddFile, SetAllowOverride, SetProtectedTemplates) with one
built in a single pass from sources declared as options. New parses every
asset together so any template can call any other, then freezes the set.
Clone re-parses from scratch, so a template calling an overridden one
picks up the new definition and the two repositories share no state.
Compose derives repositories from repositories: Rebase, Merge, Coalesce,
the last two delegating to funcmaps.Merge and funcmaps.Coalesce for the
funcmap side.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
New shared funcmap for typical go codegen.
Removed external dependencies such as sprig, etc.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi force-pushed the feat/templates-repo-immutable branch from c7b8ae2 to 5beb6d4 Compare August 21, 2026 11:55
@fredbi
fredbi merged commit 60a1639 into go-openapi:master Aug 21, 2026
21 of 22 checks passed
@fredbi
fredbi deleted the feat/templates-repo-immutable branch August 21, 2026 12:12
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.

1 participant