Feat/sheet name filter#9
Merged
Merged
Conversation
Add optional `sheetNameMarker` parameter to `GenerateFile` / `GenerateExcel`. When non-empty: - Only sheets whose names start with the marker are processed. - The marker prefix (plus any leading `_`, `-`, or space) is stripped from the sheet name before it becomes the generated class name. e.g. marker="DTGen", sheet="DTGenHeroConfig" → class "HeroConfig" This lets projects keep many auxiliary sheets (enums, text tables, reference data) in the same workbook without polluting the code-gen output. Sheets without the marker are silently skipped rather than generating a parse error.
Both ExportAll (default command) and ExportOne (data command) now accept `-sp <marker>`. When provided, only sheets whose names start with the marker are exported, and the marker is stripped when generating the class name.
Previously the -sp marker was matched against the sheet NAME, which required renaming sheets (e.g. "导出" → "DTGenHeroConfig"). This is incompatible with existing naming conventions. New behaviour: when -sp <marker> is provided, ValidSheet checks the value of the first cell in the first physical row (A1). If that value does not start with the marker, the sheet is silently skipped. - Sheet names and generated class names are unchanged - The marker cell (A1) already exists in the sheet — no schema changes - Sheets without the marker (text tables, enum refs, history tabs, etc.) are skipped without causing FormatException errors
After ParseSheetInfoRow, if DataSetType is still empty (meaning DTGen= was never set in A1), CreateGenerationContext returns immediately. This prevents RowTableParser from throwing FormatException on non-DataTables sheets like text tables, enum refs, etc. The -sp CLI flag is now redundant and will be removed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
No description provided.