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

Load user-specific settings from XDG_CONFIG_HOME #6662

Closed
FranklinYu opened this issue Jan 14, 2019 · 4 comments
Closed

Load user-specific settings from XDG_CONFIG_HOME #6662

FranklinYu opened this issue Jan 14, 2019 · 4 comments
Labels
feature request stale Issues that haven't been active in a while

Comments

@FranklinYu
Copy link

FranklinYu commented Jan 14, 2019

Is your feature request related to a problem? Please describe.

I don’t like to clutter my home directory, and I only synchronize my XDG_CONFIG_HOME.

Describe the solution you'd like

If the file ~/.rubocop.yml is missing, check whether environment variable $XDG_CONFIG_HOME is defined. If yes, then load from $XDG_CONFIG_HOME/rubocop/config.yml; otherwise load from ~/.config/rubocop/config.yml.

Describe alternatives you've considered

N/A

Additional context

Latest standard specification: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html
Arch Linux Wiki: https://wiki.archlinux.org/index.php/XDG_Base_Directory

I can try PR if anyone is interested.

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 14, 2019

PRs welcome!

@FranklinYu
Copy link
Author

FranklinYu commented Jan 14, 2019

I'm not familiar with the code base, but a simple search indicates that I should do it here:

https://github.com/rubocop-hq/rubocop/blob/19845704d148918eb9d7e8d00e1892fc7111854d/lib/rubocop/file_finder.rb#L43-L44

This is method is called from

https://github.com/rubocop-hq/rubocop/blob/19845704d148918eb9d7e8d00e1892fc7111854d/lib/rubocop/config_loader.rb#L77-L79

I'm still wondering whether FileFinder is used anywhere besides configuration loading? If so, modifying this file may affect other functions.

@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@FranklinYu
Copy link
Author

This is closed by #6895 IIUC. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request stale Issues that haven't been active in a while
Projects
None yet
Development

No branches or pull requests

3 participants