No release in over 3 years
Common RuboCop configurations used by Discourse
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 13.1.0

Runtime

>= 1.80.0
 Project Readme

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.