rubocop-discourse-base
Shared RuboCop configuration used across Discourse projects. It ships the common core cops we enable, layout preferences, and an optional rspec profile.
Installation
Add the gem to your development group:
group :development, :test do
gem "rubocop-discourse-base"
end
Configuration
Base config (core + layout) for non-Syntax Tree users:
inherit_gem:
rubocop-discourse-base: default.yml
default.yml is kept for backwards compatibility and includes our layout cops. It inherits stree-compat.yml (core cops only) plus rubocop-layout.yml.
Syntax Tree–friendly config (omits Layout cops so it can be used with the formatter):
inherit_gem:
rubocop-discourse-base: stree-compat.yml
Minimal core-only config (same cops as stree-compat.yml):
inherit_gem:
rubocop-discourse-base: rubocop-core.yml
RSpec support (requires gem "rubocop-rspec"); use with either default.yml or stree-compat.yml:
inherit_gem:
rubocop-discourse-base:
- default.yml # or stree-compat.yml
- rubocop-rspec.yml
Then run bundle exec rubocop as usual.