Skip to content

Feat/sheet name filter#9

Merged
0x5143 merged 9 commits into
masterfrom
feat/sheet-name-filter
May 17, 2026
Merged

Feat/sheet name filter#9
0x5143 merged 9 commits into
masterfrom
feat/sheet-name-filter

Conversation

@0x5143
Copy link
Copy Markdown
Contributor

@0x5143 0x5143 commented May 17, 2026

No description provided.

0x5143 and others added 9 commits May 17, 2026 11:31
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>
@0x5143 0x5143 merged commit b729c56 into master May 17, 2026
6 checks passed
@0x5143 0x5143 deleted the feat/sheet-name-filter branch May 17, 2026 09:56
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