Add config search and creation order and set default to ~/.config/lstk/config.toml#43
Open
Add config search and creation order and set default to ~/.config/lstk/config.toml#43
~/.config/lstk/config.toml#43Conversation
fe540ed to
2a3e5a7
Compare
2a3e5a7 to
8a66cef
Compare
$HOME/.config/lstk/config.toml
$HOME/.config/lstk/config.toml~/.config/lstk/config.toml
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThis pull request implements a multi-source configuration file lookup system with automatic creation and a new command to query the resolved configuration path. It introduces a formal precedence order (local project config, XDG/user config, OS-specific fallback) and adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
While
os.UserConfigDir()is the OS-standard location, most developer tools conventionally use~/.configdirectly for user-level config. To alignlstkwith common dev-tool expectations, we now prefer~/.config/lstk/config.tomlby default, and only fall back toos.UserConfigDir()/lstk/config.tomlwhen~/.configdoes not exist.To make the active config source explicit and easier to debug/document, this PR also adds a
lstk config pathcommand that prints the resolved config file path.This also unlocks project-local config support in a predictable way.
./lstk.toml>~/.config/lstk/config.toml>os.UserConfigDir()/lstk/config.toml~/.config/lstk/config.toml>os.UserConfigDir()/lstk/config.toml(if~/.configis missing)Changes
ConfigFilePath()now supports side-effect-free path resolution and returns absolute paths.ConfigDir()now reflects the resolved config file directory.lstk config pathto print the resolved configuration file path.config pathandversionTests