Skip to content

feat: read dedicated config files from their top level - #51

Merged
bhirsz merged 1 commit into
mainfrom
feat/top-level-config
Oct 8, 2026
Merged

bhirsz merged 1 commit into
mainfrom
feat/top-level-config

Conversation

@bhirsz

@bhirsz bhirsz commented Sep 30, 2026

Copy link
Copy Markdown
Member

Adds top_level_config_names: config files dedicated to the tool that may skip the [tool.<name>] table.

class RobotArgs(ArgConfig):
    config_names = ["robot.toml", "pyproject.toml"]
    top_level_config_names = ["robot.toml"]
# robot.toml (robotcode-compatible layout)
outputdir = "results"
[variable]
BROWSER = "chrome"
[profiles.ci]
loglevel = "DEBUG"
  • The [tool.<name>] section still wins when present ("accept both"). A file with both the section and other top-level keys raises an error.
  • The top-level tool table (other tools' settings, e.g. [tool.robotcode-analyze]) is ignored.
  • A dedicated file with nothing for us (only [tool.other]) is skipped, and discovery continues.
  • Only listed names are top-level during discovery. So rebot with top_level_config_names = ["rebot.toml"] still reads only [tool.rebot] from a shared robot.toml.
  • --config FILE and extends targets may use the top level too, unless the file is one of the non-dedicated config_names (e.g. pyproject.toml).
  • Discovery is unchanged otherwise: the first project file that defines the config wins, and files are never merged.

Needed by robotframework/robotframework#5773 so robot.toml can use robotcode's top-level layout. Stacked on #50.

@bhirsz
bhirsz force-pushed the feat/config-key-suggestions branch from bae9077 to 680a378 Compare September 30, 2026 20:05
@bhirsz
bhirsz force-pushed the feat/top-level-config branch from 1af1597 to de3e8c3 Compare September 30, 2026 20:05
@bhirsz
bhirsz force-pushed the feat/config-key-suggestions branch from 680a378 to 3c940ff Compare October 8, 2026 09:17
@bhirsz
bhirsz force-pushed the feat/top-level-config branch from de3e8c3 to 44e95c7 Compare October 8, 2026 09:17
Base automatically changed from feat/config-key-suggestions to main October 8, 2026 10:05
Add top_level_config_names: a listed file without the [tool.<name>] section is read from its top-level keys (skipping [tool.*] tables), like ruff.toml. The section wins when present; mixing both layouts is an error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bhirsz
bhirsz force-pushed the feat/top-level-config branch from 44e95c7 to 8588dc8 Compare October 8, 2026 10:06
@bhirsz
bhirsz merged commit cab9dac into main Oct 8, 2026
8 checks passed
@bhirsz
bhirsz deleted the feat/top-level-config branch October 8, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant