Shared Ruby and Rails code style for Lemontech products.
This gem installs 4 configuration files for tools that will make your code great again.
-
rubocop: is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.
-
reek: Code smell detector for Ruby. Code Smells
Add this line to your application's Gemfile:
gem 'our_ruby_style'
And then execute:
$ bundle
Or install it yourself as:
$ gem install our_ruby_style
-
Execute:
$ our_ruby_style install
-
Run each tool to check the entire project:
$ rubocop $ reek $ fasterer
You can use Overcommit
to lint the changed files before commiting. Example:
PreCommit:
RuboCop:
enabled: true
problem_on_unmodified_line: ignore
Fasterer:
enabled: true
problem_on_unmodified_line: ignore
Reek:
enabled: true
problem_on_unmodified_line: ignore
RailsBestPractices:
enabled: true
problem_on_unmodified_line: ignore
You need install Overcommit
gem 'overcommit'
And then execute:
$ overcommit install
If the changes causes lint errors the commit will fail until you fix them.
Bug reports and pull requests are welcome on GitHub at https://github.com/5rabbits/our_ruby_style.
The gem is available as open source under the terms of the MIT License.