From 65800d52a5c6cc6531539f675b65af4f95cfdfaf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:52:56 +0000 Subject: [PATCH 1/2] Initial plan From f78736d83d309deba52709c12f7b281f04c5b0f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:56:18 +0000 Subject: [PATCH 2/2] Fix documentation: remove non-existent Parser/set_parser references Co-authored-by: HEROgold <21345384+HEROgold@users.noreply.github.com> --- .github/copilot-instructions.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 6b5b5eb..eb5e248 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -175,24 +175,17 @@ The `with_setting` approach is more type-safe as it references an actual descrip ### Required Initialization -Always initialize Config with a file path before use. The Parser facade automatically detects and uses the appropriate adapter based on file extension: +Always initialize Config with a file path before use. The parser is auto-detected based on file extension: ```python from pathlib import Path from confkit import Config -# Simplified approach - parser is auto-detected based on file extension +# Parser is auto-detected based on file extension Config.set_file(Path("config.ini")) # Uses IniParser Config.set_file(Path("config.json")) # Uses MsgspecParser Config.set_file(Path("config.yaml")) # Uses MsgspecParser Config.set_file(Path("config.toml")) # Uses MsgspecParser -Config.set_file(Path(".env")) # Uses EnvParser - -# Option 2: Explicitly set parser (not recommended unless absolutely required) -from confkit.ext.parsers import Parser -parser = Parser(Path("config.ini")) -Config.set_parser(parser) -Config.set_file(Path("config.ini")) ``` ### Supported File Formats @@ -201,7 +194,7 @@ Config.set_file(Path("config.ini")) - **JSON files** (`.json`): Uses `MsgspecParser`, requires `msgspec` extra - **YAML files** (`.yaml`, `.yml`): Uses `MsgspecParser`, requires `msgspec` extra - **TOML files** (`.toml`): Uses `MsgspecParser`, requires `msgspec` extra -- **Environment files** (`.env`): Uses `EnvParser`, no sections (flat key-value pairs) +- **Environment files** (`.env`): Uses `EnvParser`, no sections (flat key-value pairs) — not auto-detected by `set_file` ### List Type Handling