Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support XGG base directory specification for user configuration resolution #400

Open
3 tasks
rpdelaney opened this issue May 30, 2023 · 0 comments
Open
3 tasks
Labels
enhancement New feature or request

Comments

@rpdelaney
Copy link
Contributor

Context

In #263 we added support for .mdformat.toml as an on-disk configuration file.

I would like to revisit the possibility of also reading fall-back configuration from $XDG_CONFIG_HOME.

platformdirs provides tools that can assist with this in a cross-platform way.

Proposal

The best approach I could think of is to start with the lowest priority configuration files first and work down, applying changes as we go. That way, defaults can be over-ridden by $XDG_CONFIG_HOME/mdformat.toml (or whatever we call it) but project-specific settings still take priority over any other on-disk configuration.

Descending priority would look something like (subject to negotiation):

  1. $HOME/.mdformat.toml
  2. $HOME/.config/mdformat.toml
  3. $XDG_CONFIG_HOME/mdformat.toml
  4. /.mdformat.toml
  5. /path/to/repo/.mdformat.toml

Tasks and updates

  • Confirm general strategy for config resolution
  • Confirm prioritization of different paths where we might find a config
  • Implement!
@rpdelaney rpdelaney added the enhancement New feature or request label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant