On Linux: respect XDG_CONFIG_HOME and don't store config in user's home directory
See original GitHub issueDescribe the feature
The XDG Base Directory standard states that user config files should respect the XDG_CONFIG_HOME
environment variable, which defaults $HOME/.config
.
Currently, dbt defaults the PROFILE_DIR to ~/.dbt
and doesn’t attempt to read from XDG_CONFIG_HOME or ~/.config.
mv ~/.dbt ~/.config/dbt
dbt debug
...
profiles.yml file [ERROR not found]
Describe alternatives you’ve considered
I can locally symlink my ~/.config/dbt directory to ~/.dbt, but it’s not my preference to put additional directories in my home directory. Alternately, I could set a global DBT_PROFILES_DIR
variable.
Additional context
This is only relevant to Linux users. The appdirs
pypi package makes the XDG_Base_directory standard simple to implement.
Who will this benefit?
Linux users who have far too many files/folders in their home directories.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Store settings and packages in XDG directories ... - GitHub
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either ...
Read more >XDG user directories - ArchWiki
This program reads a configuration file, and a set of default directories. It then creates localized versions of these directories in the users...
Read more >We lost control of our home directories : r/linux - Reddit
So, we have the standard XDG_CONFIG_HOME, which is ~/.config. ... Tell various programs to respect the XDG Base Directory specification ...
Read more >What are the step to move all your dotfiles into XDG directories?
Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. Any single-valued ...
Read more >XDG Base Directory Specification
$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m surprised we don’t have an issue about this yet, thanks for writing it up!
I agree, also Windows should write to
%APPDATA%\dbt
or something like that, and macos should write to~/Library/Application Support/dbt
(I think?). It looks like that library you linked might help on that front.The problem here is going to be migration. This fix is going to break stuff for a lot of people! We should do it before 1.0. We can fall back to
~/.dbt/profiles.yml
if we don’t find it in the os-specific directory. I assume we’ll still get a lot of complaints this way, but better now than later.Although we are closing this issue as stale, it’s not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers.