From 8b9984b17550c1973fcd00eb6ea5c7aed12ec78c Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:31:14 +0800 Subject: [PATCH 1/9] feat: add sheetNameMarker filter to skip non-marked sheets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../DataTableGenerator.cs | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/DataTables.GeneratorCore/DataTableGenerator.cs b/src/DataTables.GeneratorCore/DataTableGenerator.cs index c547f50..1b0cccd 100644 --- a/src/DataTables.GeneratorCore/DataTableGenerator.cs +++ b/src/DataTables.GeneratorCore/DataTableGenerator.cs @@ -20,7 +20,12 @@ public DataTableGenerator() m_Locks = new(); } - public async Task GenerateFile(string[] inputDirectories, string[] searchPatterns, string codeOutputDir, string dataOutputDir, string usingNamespace, string dataRowClassPrefix, string importNamespaces, string filterColumnTags, bool forceOverwrite, Action logger, ParseOptions? options = null, string? diagnosticsJsonOutput = null) + /// + /// 若非空,只处理名称以此前缀开头的 Sheet,且生成类名时自动去除该前缀。 + /// 例如传入 "DTGen",则 Sheet "DTGenHeroConfig" 被处理,生成类名 "HeroConfig"; + /// 不以 "DTGen" 开头的 Sheet 直接跳过。 + /// + public async Task GenerateFile(string[] inputDirectories, string[] searchPatterns, string codeOutputDir, string dataOutputDir, string usingNamespace, string dataRowClassPrefix, string importNamespaces, string filterColumnTags, bool forceOverwrite, Action logger, ParseOptions? options = null, string? diagnosticsJsonOutput = null, string sheetNameMarker = "") { // By default, ExcelDataReader throws a NotSupportedException "No data is available for encoding 1252." on .NET Core. Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); @@ -108,6 +113,7 @@ await Parallel.ForEachAsync(filePaths, async (pair, cancellationToken) => Genera prefixClassName: dataRowClassPrefix, usingStrings: usingStrings, filterColumnTags: filterColumnTags, + sheetNameMarker: sheetNameMarker, options: parseOptions, collectDiagnostic: d => allDiagnostics.Add(d), collectMetrics: m => allMetrics.Add(m), @@ -176,7 +182,7 @@ await Parallel.ForEachAsync(filePaths, async (pair, cancellationToken) => Genera Environment.ExitCode = list.Any(x => x.Failed) ? 1 : 0; } - private async Task GenerateExcel(string filePath, string usingNamespace, string prefixClassName, string[] usingStrings, string filterColumnTags, string codeOutputDir, string dataOutputDir, bool forceOverwrite, ConcurrentBag list, Action log, ParseOptions options, Action collectDiagnostic, Action collectMetrics) + private async Task GenerateExcel(string filePath, string usingNamespace, string prefixClassName, string[] usingStrings, string filterColumnTags, string codeOutputDir, string dataOutputDir, bool forceOverwrite, ConcurrentBag list, Action log, ParseOptions options, Action collectDiagnostic, Action collectMetrics, string sheetNameMarker = "") { using (var logger = new ILogger(log)) { @@ -198,18 +204,25 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string for (int i = 0; i < xssWorkbook.NumberOfSheets; i++) { var sheet = xssWorkbook.GetSheetAt(i); - if (!ValidSheet(sheet)) + if (!ValidSheet(sheet, sheetNameMarker)) { continue; } + // 若指定了 sheetNameMarker,去除前缀后用作类名,避免生成 "DTGenHeroConfig" 这样的冗余名称 + var sheetName = sheet.SheetName.Trim(); + if (!string.IsNullOrEmpty(sheetNameMarker) && sheetName.StartsWith(sheetNameMarker, StringComparison.Ordinal)) + { + sheetName = sheetName[sheetNameMarker.Length..].TrimStart('_', '-', ' '); + } + var context = new GenerationContext { FileName = Path.GetFileNameWithoutExtension(filePath), Namespace = usingNamespace, DataRowClassPrefix = prefixClassName, UsingStrings = usingStrings, - SheetName = sheet.SheetName.Trim(), + SheetName = sheetName, }; logger.Debug("Generate Excel File: [{0}]({1})", filePath.Trim('\\'), context.SheetName); @@ -260,15 +273,28 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string } } - // 检验是否过滤该Sheet - private static bool ValidSheet(ISheet? sheet) + /// + /// 检验是否处理该 Sheet。 + /// 规则: + /// 1. sheet 为 null → 跳过 + /// 2. Sheet 名称以 '#' 开头 → 跳过(注释 Sheet) + /// 3. 若指定了 sheetNameMarker,Sheet 名称不以其开头 → 跳过 + /// + private static bool ValidSheet(ISheet? sheet, string sheetNameMarker = "") { if (sheet == null) { return false; } - if (sheet.SheetName.TrimStart().StartsWith('#')) + var trimmedName = sheet.SheetName.TrimStart(); + + if (trimmedName.StartsWith('#')) + { + return false; + } + + if (!string.IsNullOrEmpty(sheetNameMarker) && !trimmedName.StartsWith(sheetNameMarker, StringComparison.Ordinal)) { return false; } From 9cc10d819e2d9c4a9feed6a1b58a2a399442154c Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:31:41 +0800 Subject: [PATCH 2/9] feat: expose -sp (sheetNameMarker) CLI parameter in dtgen Both ExportAll (default command) and ExportOne (data command) now accept `-sp `. When provided, only sheets whose names start with the marker are exported, and the marker is stripped when generating the class name. --- src/DataTables.Generator/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/DataTables.Generator/Program.cs b/src/DataTables.Generator/Program.cs index 8ca2273..90fe0f6 100644 --- a/src/DataTables.Generator/Program.cs +++ b/src/DataTables.Generator/Program.cs @@ -22,6 +22,7 @@ public class MyCommands /// -p, Prefix of class names. /// -t, Tags of filter columns. /// -f, Overwrite generated files if the content is unchanged. + /// -sp, Only export sheets whose name starts with this marker; the marker is stripped from the generated class name. E.g. "DTGen" makes sheet "DTGenHeroConfig" export as class "HeroConfig" while other sheets are skipped. [Command("")] public async Task ExportAll( string[] inputDirectories, @@ -33,6 +34,7 @@ public async Task ExportAll( string prefixClassName = "", string filterColumnTags = "", bool forceOverwrite = false, + string sheetNameMarker = "", // ParseOptions bool strictNameValidation = true, bool validateFormulaConsistency = true, @@ -66,7 +68,8 @@ public async Task ExportAll( forceOverwrite, Console.WriteLine, options, - string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput); + string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput, + sheetNameMarker: sheetNameMarker); } catch (Exception e) { @@ -88,6 +91,7 @@ public async Task ExportAll( /// -n, Namespace of generated files. /// -p, Prefix of class names. /// -t, Tags of filter columns. + /// -sp, Only export sheets whose name starts with this marker; the marker is stripped from the generated class name. [Command("data")] public async Task ExportOne( string[] inputDirectories, @@ -97,6 +101,7 @@ public async Task ExportOne( string usingNamespace = "", string prefixClassName = "", string filterColumnTags = "", + string sheetNameMarker = "", // ParseOptions bool strictNameValidation = true, bool validateFormulaConsistency = true, @@ -133,7 +138,8 @@ public async Task ExportOne( true, Console.WriteLine, options, - string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput); + string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput, + sheetNameMarker: sheetNameMarker); } catch (Exception e) { From c08263beebb18aca72517935b04737b08a194a6e Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:39:16 +0800 Subject: [PATCH 3/9] fix: change -sp filter from sheet name to first-row first-cell content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 --- .../DataTableGenerator.cs | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/DataTables.GeneratorCore/DataTableGenerator.cs b/src/DataTables.GeneratorCore/DataTableGenerator.cs index 1b0cccd..5c469c6 100644 --- a/src/DataTables.GeneratorCore/DataTableGenerator.cs +++ b/src/DataTables.GeneratorCore/DataTableGenerator.cs @@ -21,9 +21,9 @@ public DataTableGenerator() } /// - /// 若非空,只处理名称以此前缀开头的 Sheet,且生成类名时自动去除该前缀。 - /// 例如传入 "DTGen",则 Sheet "DTGenHeroConfig" 被处理,生成类名 "HeroConfig"; - /// 不以 "DTGen" 开头的 Sheet 直接跳过。 + /// 若非空,只处理**第一行第一个单元格**的值以此标记开头的 Sheet;其余 Sheet 静默跳过。 + /// Sheet 名称与生成类名均保持不变。 + /// 例如传入 "DTGen",则第一行 A1 值为 "DTGen" 的 Sheet 被处理,其他 Sheet 跳过。 /// public async Task GenerateFile(string[] inputDirectories, string[] searchPatterns, string codeOutputDir, string dataOutputDir, string usingNamespace, string dataRowClassPrefix, string importNamespaces, string filterColumnTags, bool forceOverwrite, Action logger, ParseOptions? options = null, string? diagnosticsJsonOutput = null, string sheetNameMarker = "") { @@ -209,20 +209,13 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string continue; } - // 若指定了 sheetNameMarker,去除前缀后用作类名,避免生成 "DTGenHeroConfig" 这样的冗余名称 - var sheetName = sheet.SheetName.Trim(); - if (!string.IsNullOrEmpty(sheetNameMarker) && sheetName.StartsWith(sheetNameMarker, StringComparison.Ordinal)) - { - sheetName = sheetName[sheetNameMarker.Length..].TrimStart('_', '-', ' '); - } - var context = new GenerationContext { FileName = Path.GetFileNameWithoutExtension(filePath), Namespace = usingNamespace, DataRowClassPrefix = prefixClassName, UsingStrings = usingStrings, - SheetName = sheetName, + SheetName = sheet.SheetName.Trim(), }; logger.Debug("Generate Excel File: [{0}]({1})", filePath.Trim('\\'), context.SheetName); @@ -275,10 +268,10 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string /// /// 检验是否处理该 Sheet。 - /// 规则: + /// 规则(按优先级): /// 1. sheet 为 null → 跳过 /// 2. Sheet 名称以 '#' 开头 → 跳过(注释 Sheet) - /// 3. 若指定了 sheetNameMarker,Sheet 名称不以其开头 → 跳过 + /// 3. 若指定了 sheetNameMarker,第一行第一个单元格的值不以其开头 → 跳过 /// private static bool ValidSheet(ISheet? sheet, string sheetNameMarker = "") { @@ -287,16 +280,26 @@ private static bool ValidSheet(ISheet? sheet, string sheetNameMarker = "") return false; } - var trimmedName = sheet.SheetName.TrimStart(); - - if (trimmedName.StartsWith('#')) + if (sheet.SheetName.TrimStart().StartsWith('#')) { return false; } - if (!string.IsNullOrEmpty(sheetNameMarker) && !trimmedName.StartsWith(sheetNameMarker, StringComparison.Ordinal)) + if (!string.IsNullOrEmpty(sheetNameMarker)) { - return false; + // 读取第一行第一个单元格(A1),检查其值是否以标记开头 + var firstRow = sheet.GetRow(sheet.FirstRowNum); + if (firstRow == null) + { + return false; + } + + var firstCell = firstRow.GetCell(firstRow.FirstCellNum); + var cellValue = firstCell?.ToString()?.Trim() ?? string.Empty; + if (!cellValue.StartsWith(sheetNameMarker, StringComparison.Ordinal)) + { + return false; + } } return true; From 173a6c5ad733e60eb6b7d76550d919325738df66 Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:39:50 +0800 Subject: [PATCH 4/9] docs: update -sp description to reflect first-row first-cell check --- src/DataTables.Generator/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataTables.Generator/Program.cs b/src/DataTables.Generator/Program.cs index 90fe0f6..7ad3d9d 100644 --- a/src/DataTables.Generator/Program.cs +++ b/src/DataTables.Generator/Program.cs @@ -22,7 +22,7 @@ public class MyCommands /// -p, Prefix of class names. /// -t, Tags of filter columns. /// -f, Overwrite generated files if the content is unchanged. - /// -sp, Only export sheets whose name starts with this marker; the marker is stripped from the generated class name. E.g. "DTGen" makes sheet "DTGenHeroConfig" export as class "HeroConfig" while other sheets are skipped. + /// -sp, Only export sheets whose first row / first cell (A1) value starts with this marker. Sheet names and generated class names are not modified. E.g. "DTGen" makes only sheets with A1="DTGen" be exported; sheets without the marker are silently skipped. [Command("")] public async Task ExportAll( string[] inputDirectories, @@ -91,7 +91,7 @@ public async Task ExportAll( /// -n, Namespace of generated files. /// -p, Prefix of class names. /// -t, Tags of filter columns. - /// -sp, Only export sheets whose name starts with this marker; the marker is stripped from the generated class name. + /// -sp, Only export sheets whose first row / first cell (A1) value starts with this marker. Sheet names and generated class names are not modified. [Command("data")] public async Task ExportOne( string[] inputDirectories, From 16f829af0d245e1f789f6e19c55d3c6fda2c5d05 Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:51:42 +0800 Subject: [PATCH 5/9] refactor: change DataSetType default to empty; absent DTGen= means skip --- src/DataTables.GeneratorCore/GenerationContext.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DataTables.GeneratorCore/GenerationContext.cs b/src/DataTables.GeneratorCore/GenerationContext.cs index bdc0ed2..e0ffc28 100644 --- a/src/DataTables.GeneratorCore/GenerationContext.cs +++ b/src/DataTables.GeneratorCore/GenerationContext.cs @@ -18,7 +18,13 @@ public class GenerationContext public string DataRowClassPrefix { get; set; } = string.Empty; - public string DataSetType { get; set; } = "table"; + /// + /// 表结构类型:table / matrix / column。 + /// 默认为空字符串;仅在 A1 单元格中声明了 DTGen= 时才会被赋值。 + /// CreateGenerationContext 解析完 A1 后会检查此值是否为空,若为空则认为该 Sheet + /// 不是 DataTables 格式并跳过后续解析。 + /// + public string DataSetType { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; @@ -252,4 +258,3 @@ public class XField(int index) /// public bool IsTagFiltered { get; set; } } - From b6d95ebf4f557b10d21a0d9580d5f42ca92f7560 Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:54:17 +0800 Subject: [PATCH 6/9] feat: skip sheets without DTGen= in A1 without needing -sp flag 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. --- src/DataTables.GeneratorCore/DataTableProcessor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DataTables.GeneratorCore/DataTableProcessor.cs b/src/DataTables.GeneratorCore/DataTableProcessor.cs index 56227e4..478abf6 100644 --- a/src/DataTables.GeneratorCore/DataTableProcessor.cs +++ b/src/DataTables.GeneratorCore/DataTableProcessor.cs @@ -66,6 +66,12 @@ public void CreateGenerationContext(ISheet sheet) var headerRow = sheet.GetRow(headerRowIndex); ParseSheetInfoRow(GetCellString(headerRow.GetCell(headerRow.FirstCellNum))); + // A1 未声明 DTGen=,该 Sheet 不是 DataTables 格式,静默跳过 + if (string.IsNullOrEmpty(m_Context.DataSetType)) + { + return; + } + // 按模式选择解析器 ITableSchemaParser parser = m_Context.DataSetType == "matrix" ? new MatrixTableParser() From dc058b960b051c58a09040cc6b1dd6d4a483e5fa Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:55:32 +0800 Subject: [PATCH 7/9] refactor: remove -sp / sheetNameMarker; DTGen= in A1 is now self-sufficient --- .../DataTableGenerator.cs | 40 +++++-------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/src/DataTables.GeneratorCore/DataTableGenerator.cs b/src/DataTables.GeneratorCore/DataTableGenerator.cs index 5c469c6..ab9e670 100644 --- a/src/DataTables.GeneratorCore/DataTableGenerator.cs +++ b/src/DataTables.GeneratorCore/DataTableGenerator.cs @@ -20,12 +20,7 @@ public DataTableGenerator() m_Locks = new(); } - /// - /// 若非空,只处理**第一行第一个单元格**的值以此标记开头的 Sheet;其余 Sheet 静默跳过。 - /// Sheet 名称与生成类名均保持不变。 - /// 例如传入 "DTGen",则第一行 A1 值为 "DTGen" 的 Sheet 被处理,其他 Sheet 跳过。 - /// - public async Task GenerateFile(string[] inputDirectories, string[] searchPatterns, string codeOutputDir, string dataOutputDir, string usingNamespace, string dataRowClassPrefix, string importNamespaces, string filterColumnTags, bool forceOverwrite, Action logger, ParseOptions? options = null, string? diagnosticsJsonOutput = null, string sheetNameMarker = "") + public async Task GenerateFile(string[] inputDirectories, string[] searchPatterns, string codeOutputDir, string dataOutputDir, string usingNamespace, string dataRowClassPrefix, string importNamespaces, string filterColumnTags, bool forceOverwrite, Action logger, ParseOptions? options = null, string? diagnosticsJsonOutput = null) { // By default, ExcelDataReader throws a NotSupportedException "No data is available for encoding 1252." on .NET Core. Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); @@ -113,7 +108,6 @@ await Parallel.ForEachAsync(filePaths, async (pair, cancellationToken) => Genera prefixClassName: dataRowClassPrefix, usingStrings: usingStrings, filterColumnTags: filterColumnTags, - sheetNameMarker: sheetNameMarker, options: parseOptions, collectDiagnostic: d => allDiagnostics.Add(d), collectMetrics: m => allMetrics.Add(m), @@ -182,7 +176,7 @@ await Parallel.ForEachAsync(filePaths, async (pair, cancellationToken) => Genera Environment.ExitCode = list.Any(x => x.Failed) ? 1 : 0; } - private async Task GenerateExcel(string filePath, string usingNamespace, string prefixClassName, string[] usingStrings, string filterColumnTags, string codeOutputDir, string dataOutputDir, bool forceOverwrite, ConcurrentBag list, Action log, ParseOptions options, Action collectDiagnostic, Action collectMetrics, string sheetNameMarker = "") + private async Task GenerateExcel(string filePath, string usingNamespace, string prefixClassName, string[] usingStrings, string filterColumnTags, string codeOutputDir, string dataOutputDir, bool forceOverwrite, ConcurrentBag list, Action log, ParseOptions options, Action collectDiagnostic, Action collectMetrics) { using (var logger = new ILogger(log)) { @@ -204,7 +198,7 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string for (int i = 0; i < xssWorkbook.NumberOfSheets; i++) { var sheet = xssWorkbook.GetSheetAt(i); - if (!ValidSheet(sheet, sheetNameMarker)) + if (!ValidSheet(sheet)) { continue; } @@ -226,8 +220,7 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string var genSw = System.Diagnostics.Stopwatch.StartNew(); try { - // 初始化GenerateContext - // 仍使用 NPOI sheet;解析器内部已使用抽象层 + // 初始化GenerateContext;若 A1 未声明 DTGen= 则内部静默返回 processor.CreateGenerationContext(sheet); if (!processor.ValidateGenerationContext()) { @@ -268,12 +261,14 @@ private async Task GenerateExcel(string filePath, string usingNamespace, string /// /// 检验是否处理该 Sheet。 - /// 规则(按优先级): + /// 规则: /// 1. sheet 为 null → 跳过 /// 2. Sheet 名称以 '#' 开头 → 跳过(注释 Sheet) - /// 3. 若指定了 sheetNameMarker,第一行第一个单元格的值不以其开头 → 跳过 + /// + /// 注意:A1 是否声明 DTGen= 的检查在 DataTableProcessor.CreateGenerationContext 内部完成, + /// 未声明时会静默返回,不会抛出 FormatException。 /// - private static bool ValidSheet(ISheet? sheet, string sheetNameMarker = "") + private static bool ValidSheet(ISheet? sheet) { if (sheet == null) { @@ -285,23 +280,6 @@ private static bool ValidSheet(ISheet? sheet, string sheetNameMarker = "") return false; } - if (!string.IsNullOrEmpty(sheetNameMarker)) - { - // 读取第一行第一个单元格(A1),检查其值是否以标记开头 - var firstRow = sheet.GetRow(sheet.FirstRowNum); - if (firstRow == null) - { - return false; - } - - var firstCell = firstRow.GetCell(firstRow.FirstCellNum); - var cellValue = firstCell?.ToString()?.Trim() ?? string.Empty; - if (!cellValue.StartsWith(sheetNameMarker, StringComparison.Ordinal)) - { - return false; - } - } - return true; } From 61beb1cfb814fa76877ab99636fadc33b93b295c Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 11:55:32 +0800 Subject: [PATCH 8/9] refactor: remove -sp parameter from CLI; DTGen= in A1 handles filtering --- src/DataTables.Generator/Program.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/DataTables.Generator/Program.cs b/src/DataTables.Generator/Program.cs index 7ad3d9d..85d59b7 100644 --- a/src/DataTables.Generator/Program.cs +++ b/src/DataTables.Generator/Program.cs @@ -17,12 +17,11 @@ public class MyCommands /// -patterns, Input file wildcard. /// -co, Code output file directory. /// -do, Data output file directory. - /// -ins, Import namespaces of generated files, split with char '&' for multiple namespaces. + /// -ins, Import namespaces of generated files, split with char '&' for multiple namespaces. /// -n, Namespace of generated files. /// -p, Prefix of class names. /// -t, Tags of filter columns. /// -f, Overwrite generated files if the content is unchanged. - /// -sp, Only export sheets whose first row / first cell (A1) value starts with this marker. Sheet names and generated class names are not modified. E.g. "DTGen" makes only sheets with A1="DTGen" be exported; sheets without the marker are silently skipped. [Command("")] public async Task ExportAll( string[] inputDirectories, @@ -34,7 +33,6 @@ public async Task ExportAll( string prefixClassName = "", string filterColumnTags = "", bool forceOverwrite = false, - string sheetNameMarker = "", // ParseOptions bool strictNameValidation = true, bool validateFormulaConsistency = true, @@ -68,8 +66,7 @@ public async Task ExportAll( forceOverwrite, Console.WriteLine, options, - string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput, - sheetNameMarker: sheetNameMarker); + string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput); } catch (Exception e) { @@ -87,11 +84,10 @@ public async Task ExportAll( /// -i, Input file directory(search recursive). /// -patterns, Input file wildcard. /// -do, Data output file directory. - /// -ins, Import namespaces of generated files, split with char '&' for multiple namespaces. + /// -ins, Import namespaces of generated files, split with char '&' for multiple namespaces. /// -n, Namespace of generated files. /// -p, Prefix of class names. /// -t, Tags of filter columns. - /// -sp, Only export sheets whose first row / first cell (A1) value starts with this marker. Sheet names and generated class names are not modified. [Command("data")] public async Task ExportOne( string[] inputDirectories, @@ -101,7 +97,6 @@ public async Task ExportOne( string usingNamespace = "", string prefixClassName = "", string filterColumnTags = "", - string sheetNameMarker = "", // ParseOptions bool strictNameValidation = true, bool validateFormulaConsistency = true, @@ -138,8 +133,7 @@ public async Task ExportOne( true, Console.WriteLine, options, - string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput, - sheetNameMarker: sheetNameMarker); + string.IsNullOrWhiteSpace(diagnosticsJsonOutput) ? null : diagnosticsJsonOutput); } catch (Exception e) { From a309513dfccbc056a795ec2e9e8ddc6fdc973245 Mon Sep 17 00:00:00 2001 From: huangqc Date: Sun, 17 May 2026 17:34:08 +0800 Subject: [PATCH 9/9] ci: re-trigger CI for Unity 6 transient failure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>