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

Set rubocop config with environment variable #6

Closed
wants to merge 2 commits into from
Closed

Set rubocop config with environment variable #6

wants to merge 2 commits into from

Conversation

elstgav
Copy link
Contributor

@elstgav elstgav commented May 26, 2015

Re-worked from #5:

I'm looking to add this option to support the SublimeLinter plugin I'm writing (see related issue). The main problem I've run into is that while editing your files, SublimeLinter will create a temporary copy to lint. Since the tmp file is in a separate directory, rubocop won't correctly determine the config location (the slim-lint config, however, is manually set).

This would also allow users to keep a separate rubocop configuration for their slim files if they so choose.

As suggested, this pull request lets you set the config with an environment variable.

Things left to do:

  • Add a note to the documentation
  • Test the functionality. I'm not sure how to set that test up though; would I need to create a dummy .rubocop.yml file?

This enables the use of a separate rubocop config for your slim files,
and supports live-linting tools that lint files in temporary paths
@sds
Copy link
Owner

sds commented May 28, 2015

Thanks for the pull request, @elstgav.

I've merged your commit in 15e87b4 with some modifications in bf0a484...9b15cc4, including tests and renaming the variable to SLIM_LINT_RUBOCOP_CONF (to be explicit).

Let me know if there's anything else you need to support the integration with Sublime. If not, I'll cut a new release (would be great if you could test that everything works as expected on your end).

@sds sds closed this May 28, 2015
@elstgav elstgav deleted the rubocop-env-var branch May 28, 2015 16:24
@elstgav
Copy link
Contributor Author

elstgav commented May 29, 2015

After learning some more Python and stumbling through getting my environment set up correctly, I can confirm that yes, it does work as expected. Thanks for your help! I'll push out an update to my plugin as soon as you cut the gem.

elstgav added a commit to elstgav/SublimeLinter-slim-lint that referenced this pull request May 29, 2015
@sds
Copy link
Owner

sds commented May 31, 2015

I've just released 0.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants