Skip to content

Config declaration boilerplate: one confkit Config line per value #4

Description

@HEROgold

Adding a single new configuration value currently touches four places in src/funcsort/config.py, plus a CLI flag in src/funcsort/main.py:

  1. the Attributes: docstring section on Settings (l. 42-49)
  2. the Settings dataclass field (l. 51-57)
  3. the _Cfg descriptor inside class tool: class funcsort: (l. 80-84)
  4. the Settings(...) kwarg in load_settings (l. 87-93)

plus Argument(...) in main.py for the CLI flag.

From the review of #2:

TODO for later, so creating an issue for this is required. Adding a new configuration value adds 4 new lines here, and one new line in main.py (althought that's just the CLI flags). That should be a single line added, using confkit's Config.

Goal: adding a config value should be a single confkit Config declaration, with Settings (or its replacement) derived from the confkit container rather than mirrored by hand.

Related: #5 — if args and settings become coupled, the merge lines at main.py:85-86 need re-reviewing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions