RuboCop Bridgetown
A RuboCop extension to enforce common code style in Bridgetown plugins.
Installation
Just install the rubocop-bridgetown
gem
gem install rubocop-bridgetown
or if you prefer Bundler, add it to your Gemfile
or gemspec
# Gemfile
gem "rubocop-bridgetown", "~> 0.2"
# <plugin>.gemspec
spec.add_development_dependency "rubocop-bridgetown", "~> 0.2"
and run bundle install
Usage
You need to tell RuboCop to load the extension and inherit the custom RuboCop configuration advocated by Bridgetown.
Place the following at the top of your .rubocop.yml
.
require: rubocop-bridgetown
inherit_gem:
rubocop-bridgetown: .rubocop.yml
Running bundle exec rubocop
will now automatically load the rubocop-bridgetown
cops together with the standard cops.
Exclude Folders List
Currently it seems Rubocop doesn't inherit the Excludes
folder list from the gem configuration, so you may want to add it manually to your .rubocop.yml
file:
AllCops:
Exclude:
- bin/**/*
- exe/**/*
- benchmark/**/*
- node_modules/**/*
- script/**/*
- vendor/**/*
- tmp/**/*
Customization
You can override any settings inherited from the extension by subsequently redefining the concerned parameters.