This linter plugin for Linter provides an interface to rubocop. It will be used with files that have the “Ruby” syntax.
Linter package must be installed in order to use this plugin. If Linter is not installed, please follow the instructions here.
Before using this plugin, you must ensure that rubocop
, version 0.37 or
greater, is installed on your system. To install rubocop
, do the following:
Now you can proceed to install the linter-rubocop plugin.
apm install linter-rubocop
You can configure linter-rubocop by editing ~/.atom/config.cson
(choose Open Your Config in Atom menu):
'linter-rubocop':
'executablePath': null # rubocop path.
Run which rubocop
to find the path, if you using rbenv run
rbenv which rubocop
Note: This plugin finds the nearest .rubocop.yml
file and uses the
--config
command line argument to use that file, so you may not use the
--config
argument in the linter settings.
If you're using RVM and receiving errors in Atom that indicate Rubocop can't be
found, you may need to change /bin
to /wrappers
in the path that gets
returned from which rubocop
before using it as your executablePath
setting.
For example, change:
/Users/JohnDoe/.rvm/gems/ruby-2.2.4@global/bin/rubocop
To:
/Users/JohnDoe/.rvm/gems/ruby-2.2.4@global/wrappers/rubocop
If you would like to contribute enhancements or fixes, please do the following:
- Fork the plugin repository.
- Hack on a separate topic branch created from the latest
master
. - Commit and push the topic branch.
- Make a pull request.
- Welcome to the club!
Please note that modifications should follow these coding guidelines:
- Indent is 2 spaces.
- Code should pass the
coffeelint
linter. - Vertical whitespace helps readability, don’t be afraid to use it.
Thank you for helping out!