Repository navigation
feat: add typed Excelize style extraction - #1
Merged
Merged
Conversation
tomtwinkle
marked this pull request as ready for review
October 9, 2026 01:13
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.
Add extraction and typed reuse of effective XLSX cell styles. The existing style helpers relied on incomplete, hand-maintained constants; generated enums and definitions now cover every public Style field in Excelize v2.10.1 while preserving custom values.
Changes
Document every enum type and constant in GoDoc, with references to the official Excelize Style documentation. Generate these comments and test their presence so regeneration preserves them.
Add
excelizeutil.GetStylefor effective cell styles, including inherited formatting, colors, number formats, alignment, and protection.Add
GetStyleDefinitionand generatedStyleDefinition,BorderDefinition,FillDefinition,FontDefinition,AlignmentDefinition, andProtectionDefinitionwith bidirectional Excelize conversion.Generate public enums for categorical choices and all field names. Preserve arbitrary numeric/text values, booleans, nil pointers, and empty slices.
Parse Excelize AST tables and documentation for patterns, borders, fill types, gradients, alignment, fonts, number formats, languages, and public fields. Use explicit OOXML definitions where Excelize provides no enum table.
Generate gradient geometry and stop positions for the extractor. Preserve the existing style helper API and border-style aliases.
Refresh generated files with
go generate ./excelizeutil; tests fail when they differ from the selected dependency.Validation
go test ./...passes with Excelize v2.10.1 on the updated main tree.Limits
Typed conversion preserves the complete public Style input. Workbook extraction remains limited by Excelize and OOXML representation: cell fill transparency, arbitrary gradient geometry, both pattern colors, and original formatting inputs cannot always be recovered. New upstream fields are added to definitions automatically, but their workbook extraction semantics still require review. See
excelizestyle/README.mdandexcelizeutil/STYLE_COVERAGE.md.