Skip to content

feat: resolve config paths relative to the config file - #52

Merged
bhirsz merged 1 commit into
mainfrom
feat/config-relative-paths
Oct 8, 2026
Merged

bhirsz merged 1 commit into
mainfrom
feat/config-relative-paths

Conversation

@bhirsz

@bhirsz bhirsz commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Adds relative_to_config for options and arguments:

  • True: relative paths set in a config file resolve against the directory of the file that sets them (including extends files and profiles).
  • "existing": resolve only when the value (or its part before a :args/;args suffix, Windows drive colons aware) exists there - for values that may be a path or a module name, e.g. listener = ["MyListener", "tools/listener.py:arg"].

CLI/env values are unchanged.

Motivation: paths = ["tests"] / outputdir / listeners in robot.toml should work when robot runs from a subdirectory (robotframework/robotframework#5773).

Stacked on #51.

@bhirsz
bhirsz force-pushed the feat/config-relative-paths branch 3 times, most recently from ae6717f to cf638e4 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-relative-paths branch from cf638e4 to b380f95 Compare October 8, 2026 09:17
@bhirsz
bhirsz force-pushed the feat/top-level-config branch 2 times, most recently from 44e95c7 to 8588dc8 Compare October 8, 2026 10:06
Base automatically changed from feat/top-level-config to main October 8, 2026 10:07
Add `relative_to_config` to `option()` and `argument()`. With `True`,
relative path strings (or string list items) set in a config file are
resolved against the directory of the file that sets them - the
discovered/explicit config, each `extends`-ed file and profiles - so a tool
behaves the same when run from a subdirectory. With `"existing"`, a value is
resolved only when it (or its part before a `:args`/`;args` suffix) exists
there, for values that may also be module names. Command-line and
environment values are left untouched.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bhirsz
bhirsz force-pushed the feat/config-relative-paths branch from b380f95 to 0b0e91e Compare October 8, 2026 10:08
@bhirsz
bhirsz merged commit 1fec98d into main Oct 8, 2026
8 checks passed
@bhirsz
bhirsz deleted the feat/config-relative-paths branch October 8, 2026 10:15
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