This is a collection of cops developed and used by 84codes AB This code is based heavily upon the rubocop-gitlab-security code released under the MIT License.
Just install the rubocop-eightyfourcodes
gem
gem install rubocop-eightyfourcodes
or if you use bundler put this in your Gemfile
gem 'rubocop-eightyfourcodes'
You need to tell RuboCop to load the eightyfourcodes extension. There are three ways to do this:
Put this into your .rubocop.yml
.
require: rubocop-eightyfourcodes
Now you can run rubocop
and it will automatically load the RuboCop eightyfourcodes
cops together with the standard cops.
rubocop --require rubocop-eightyfourcodes
RuboCop::RakeTask.new do |task|
task.requires << 'rubocop-eightyfourcodes'
end
By default, rubocop-eightyfourcodes
inspects all files. You can override this setting in your config file by specifying one or more patterns:
# Inspect all files
AllCops:
EightyFourCodes:
Patterns:
- '.+'
# Inspect only controller files.
AllCops:
EightyFourCodes:
Patterns:
- app/controllers/**/*.rb
All cops are located under
lib/rubocop/cop/eighty_four_codes
, and contain
examples/documentation.
In your .rubocop.yml
, you may treat the eightyfourcodes cops just like any other
cop. For example:
EightyFourCodes/CommandLiteralInjection:
Exclude:
- 'spec/**/*'
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)rubocop-eightyfourcodes
is MIT licensed. See the accompanying file for
the full text.