Skip to content

Respect --config-path during config loading#331

Merged
drwl merged 1 commit into
mainfrom
fix-runner-config-path-regression
May 8, 2026
Merged

Respect --config-path during config loading#331
drwl merged 1 commit into
mainfrom
fix-runner-config-path-regression

Conversation

@OdenTakashi
Copy link
Copy Markdown
Collaborator

Problem

#301 added support for loading a config file from a custom path via --config-path. However, #293 changed Runner#run so that the config is loaded before CLI arguments are parsed.

As a result, --config-path was only parsed after the config had already been loaded, meaning the custom path was not used when deciding which config file to read.

Solution

Parse CLI arguments before loading the config in Runner#run.

This ensures that the value passed to --config-path is applied to ConfigFinder.config_path before ConfigLoader.load_config is called.

## Problem
#301 added support for loading a config file from a custom path via `--config-path`.
However, #293 changed `Runner#run` so that the config is loaded before CLI arguments are parsed.

As a result, `--config-path` was only parsed after the config had already been loaded,
meaning the custom path was not used when deciding which config file to read.

## Solution
Parse CLI arguments before loading the config in `Runner#run`.

This ensures that the value passed to `--config-path` is applied to
`ConfigFinder.config_path` before `ConfigLoader.load_config` is called.
Copy link
Copy Markdown
Owner

@drwl drwl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the detailed write up, it was easy for me to understand.

@drwl drwl merged commit 4d32da1 into main May 8, 2026
50 checks passed
@drwl drwl deleted the fix-runner-config-path-regression branch May 8, 2026 22:51
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.

2 participants