question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On Linux: respect XDG_CONFIG_HOME and don't store config in user's home directory

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
beckjakecommented, Jun 8, 2020

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.

0reactions
github-actions[bot]commented, Jun 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found