No commit activity in last 3 years
No release in over 3 years
Commsworld rubocop config and cops
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.10

Runtime

 Project Readme

rubocop-commsworld

Common rubocop configuration and custom cops. Replaces commsworld/house-style which was config-only.

Installation

Add the gem as a dependency to your project's Gemfile:

gem "rubocop-commsworld", github: "commsworld/rubocop-commsworld", group: [:development, :test]

And install with bundle install.

Usage

Configure rubocop in your project by creating a file in the root directory of the project, .rubocop.yml:

require:
  - rubocop-commsworld
  - rubocop-rails
  - rubocop-rspec

Cops

Commsworld/UnspecifiedModelPrivacy

Issues an offence when a class is defined within a module which does not have an adjacent privacy definition. By default, configured to only run on app/models.

The motivation is to enforce the use of Private ActiveRecord models where appropriate.

# bad
module Things
  class Thing < ApplicationRecord
  end
end

# good
module Things
  class Thing < ApplicationRecord
  end

  private_constant :Thing # or public_constant
end

License

The gem is available as open source under the terms of the [MIT License].