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

Add XDG configuration #376

Open
bkuhlmann opened this issue Dec 12, 2020 · 0 comments
Open

Add XDG configuration #376

bkuhlmann opened this issue Dec 12, 2020 · 0 comments

Comments

@bkuhlmann
Copy link

bkuhlmann commented Dec 12, 2020

Overview

I would like to propose using the the XDG specification for managing this gem's configuration which is a UNIX standard. Example:

# Global (default)
$HOME/.config/rubycritic/configuration.yml

# Local (alternative per project configuration -- Takes precedence over global configuration)
$HOME/projects/my_example/.config/rubycritic/configuration.yml

This can be easily solved by using the XDG gem as a dependency to this project. Even better, you can use the Runcom gem which is a superset of XDG for allowing users to have either a global and/or local configuration since XDG doesn't support local configurations by default.

Doing this work would resolve the following related issues:

Screenshots/Screencasts

Here's an example of ruby code used in the Rubysmith project to show how easy it would be to implement this:

image

💡 Associated source code can be found here.

Desired Behavior

By using Runcom, which is built on top of XDG, you'd get the following enhancements for free:

  • Checks to see if local configuration exists and loads it.
  • If local configuration doesn't exist, then it checks to see if global configuration exists and loads it.
  • If global configuration doesn't exist, then default Rubycritic configuration is loaded instead.

By doing this work, we'd have a way to remove .rubycritic.yml from the root of everyone's projects.

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

No branches or pull requests

1 participant