Skip to content

fix: environment variables now correctly take precedence over config file values#88

Merged
schpet merged 1 commit into
schpet:mainfrom
kfrance:fix-env-var-precedence
Jan 7, 2026
Merged

fix: environment variables now correctly take precedence over config file values#88
schpet merged 1 commit into
schpet:mainfrom
kfrance:fix-env-var-precedence

Conversation

@kfrance

@kfrance kfrance commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes precedence order in getRawOption so environment variables take priority over config file values, matching the README documentation
  • Adds subprocess-based tests that verify the correct precedence behavior

Details

The README states that "environment variables take precedence over config file values", but the code had the opposite behavior. This fix corrects the precedence order:

  1. CLI flags (highest priority)
  2. Environment variables
  3. Config file (lowest priority)

Test plan

  • Added test verifying env vars win when both env var and config file are present
  • Added test verifying config file is used as fallback when no env var is set
  • All existing tests pass

🤖 Generated with Claude Code

…file values

The README documented that environment variables take precedence over
config file values, but the code had the opposite behavior. This fix
corrects the precedence order in getRawOption to match the documentation:

1. CLI flags (highest priority)
2. Environment variables
3. Config file (lowest priority)

Also adds subprocess-based tests that verify:
- Env vars win when both env var and config file are present
- Config file is used as fallback when no env var is set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@schpet schpet merged commit 0a732c3 into schpet:main Jan 7, 2026
7 checks passed
@schpet

schpet commented Jan 7, 2026

Copy link
Copy Markdown
Owner

thanks!

@kfrance kfrance deleted the fix-env-var-precedence branch January 9, 2026 08:32
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