Skip to content

Feat/new mangling#17

Merged
fredbi merged 4 commits into
go-openapi:masterfrom
fredbi:feat/new-mangling
Jul 15, 2026
Merged

Feat/new mangling#17
fredbi merged 4 commits into
go-openapi:masterfrom
fredbi:feat/new-mangling

Conversation

@fredbi

@fredbi fredbi commented Jul 15, 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 added 3 commits July 15, 2026 17:43
The intent of this new mangler is to expose a new interface that
solves more efficiently the woes of swag/mangling.

1. proper tokenization - case alternance separates token (so no longer
   AAA => A_A_A)
2. asciification - so unicode processing etc is safer and provides
   better results
3. verbalisation of numerical values - so no need for a clumsy "prefix"
   rule
4. onboards all overrides that used to be implemented in go-swagger to
   check for reserved keywords, file suffixes with special meaning, go
   package rules etc
5. special "ConstName" method to try harder on numerical values than
   mere go idents (i.e. verbalize all numerical values)

The library maps the unicode dataset (unicode v15, then v17 starting
with go1.27) to find verbalisations.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi fredbi force-pushed the feat/new-mangling branch 2 times, most recently from f424ee7 to 0e38f5f Compare July 15, 2026 17:24
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi fredbi force-pushed the feat/new-mangling branch from 0e38f5f to 1826d54 Compare July 15, 2026 17:28
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.10667% with 673 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.06%. Comparing base (56a096b) to head (1826d54).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
mangling/ucd/cmd/gen_runewords/gen_runewords.go 0.00% 341 Missing ⚠️
mangling/ucd/cmd/gen_asciifold/gen_asciifold.go 0.00% 113 Missing ⚠️
mangling/ucd/cmd/gen_numerals/gen_numerals.go 0.00% 101 Missing ⚠️
mangling/ucd/internal/locate/root.go 0.00% 67 Missing ⚠️
mangling/ascii_fold.go 91.00% 5 Missing and 4 partials ⚠️
mangling/go_mangler.go 95.58% 5 Missing and 3 partials ⚠️
mangling/assembler.go 93.02% 6 Missing ⚠️
mangling/internal/tokens/tokenizer.go 93.02% 5 Missing and 1 partial ⚠️
mangling/numbers/fraction.go 94.25% 3 Missing and 2 partials ⚠️
mangling/initialisms.go 96.03% 2 Missing and 2 partials ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #17       +/-   ##
===========================================
- Coverage   85.83%   67.06%   -18.77%     
===========================================
  Files          16       31       +15     
  Lines        1560     2663     +1103     
===========================================
+ Hits         1339     1786      +447     
- Misses        202      843      +641     
- Partials       19       34       +15     

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

@fredbi fredbi merged commit db8ecef into go-openapi:master Jul 15, 2026
19 of 21 checks passed
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