whitesmith / whitesmith/rubycritic
Add XDG configuration
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 3.5k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
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:
- Add settings file.
- Add excluded paths/files.
- Reek configuration not being picked up.
- Configuration integrity - This one may or may not be resolved with this work but thought I'd mention it regardless.
Screenshots/Screencasts
Here's an example of ruby code used in the Rubysmith project to show how easy it would be to implement this:

💡 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced lib/rubysmith/cli/configuration.rb example and inspect how Rubycritic currently finds .rubycritic.yml. Verify the desired precedence of local configuration, global configuration, and defaults, then confirm that the root-level .rubycritic.yml can be removed without losing the related configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100