Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3: How to configure rubocop.yml path in sublime settings?

I have installed rubocop package for sublime text 3. I am trying to set custom rubocop configuration by providing rubocop.yml path to Rubocop.sublime-settings. Please find my configuration-snippet

  "rubocop_config_file":  "./.rubocop.yml"

However rubocop does not work when I give this configuration. It only works for

  "rubocop_config_file":  ""

How can i fix this and provide the path of my rubocop.yml to rubocop?

like image 902
ArMD Avatar asked Oct 24 '25 12:10

ArMD


2 Answers

After some prodding, I found this :

By default, the linter plugin looks for a config file called .rubocop.yml in the current directory and its parents - https://github.com/SublimeLinter/SublimeLinter-rubocop

Even though I am not using the linter-plugin, I figured rubocop does the same. So by placing the .rubocop.yml in the current directory or any of its parents, I was able to get my .rubcop.yml file to be picked by rubocop. On a side note, I did not update configuration of the rubocop package, it automatically picks the .rubocop.yml.

like image 81
ArMD Avatar answered Oct 27 '25 02:10

ArMD


Other settings in this Rubocop.sublime-settings seem to use a complete path.

So instead of using the dot to start at the folder where the Rubocop.sublime-settings file is located use a full path like the examples for other Rubocop.sublime-settings configurations.

Hope this helps

like image 29
Runningriot Avatar answered Oct 27 '25 03:10

Runningriot