From 211a2e2af75bc73cd96622d7389a56b21df9858f Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 25 Nov 2025 17:49:58 +1100 Subject: [PATCH] Code comments --- src/jinjaturtle/core.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/jinjaturtle/core.py b/src/jinjaturtle/core.py index 03b159b..b2ea3d2 100644 --- a/src/jinjaturtle/core.py +++ b/src/jinjaturtle/core.py @@ -41,7 +41,7 @@ _TurtleDumper.add_representer(QuotedString, _quoted_str_representer) def detect_format(path: Path, explicit: str | None = None) -> str: """ - Determine config format (toml, yaml, ini-ish) from argument or filename. + Determine config format (toml, yaml, json, ini-ish) from argument or filename. """ if explicit: return explicit @@ -61,10 +61,7 @@ def detect_format(path: Path, explicit: str | None = None) -> str: def parse_config(path: Path, fmt: str | None = None) -> tuple[str, Any]: """ - Parse config file into a Python object: - - TOML -> nested dict - INI -> configparser.ConfigParser + Parse config file into a Python object """ fmt = detect_format(path, fmt) @@ -183,10 +180,10 @@ def make_var_name(role_prefix: str, path: Iterable[str]) -> str: def _split_inline_comment(text: str, comment_chars: set[str]) -> tuple[str, str]: """ - Split 'value # comment' into (value_part, comment_part), where + Split 'value # comment' into (value_part, comment_part), where comment_part starts at the first unquoted comment character. - comment_chars is e.g. {'#'} for TOML, {'#', ';'} for INI. + comment_chars is e.g. {'#'} for TOML/YAML, {'#', ';'} for INI. """ in_single = False in_double = False