MrlixiangWE commented on code in PR #166:
URL: https://github.com/apache/otava/pull/166#discussion_r3849486448


##########
otava/csv_options.py:
##########
@@ -17,6 +17,39 @@
 
 import enum
 from dataclasses import dataclass
+from typing import Optional
+
+import configargparse
+
+
+@dataclass
+class CsvConfig:
+    NAME = "csv"
+
+    delimiter: Optional[str] = None
+    quote_char: Optional[str] = None
+
+    @staticmethod
+    def add_parser_args(arg_group):
+        arg_group.add_argument(
+            "--csv-delimiter",

Review Comment:
   Good catch — fixed. Both options now use a `single_character` type 
validator, so a multi-character value is rejected when the configuration is 
parsed:
   
       error: argument --csv-delimiter: must be a single character, got '::'
   
   That covers the config file, the CLI flag and the environment variable, with 
tests for each. The per-test `csv_options` keys still accept multi-character 
values, but that behavior predates this PR — I can tighten it here too if you 
prefer.
   
   Also rebased onto de46ddf.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to