Nucop Cops
Custom RuboCop cops for Nulogy's Ruby projects.
Installation
Add this line to your application's Gemfile:
gem "nucop-cops"And then execute:
bundle installUsage
Add the following to your .rubocop.yml:
require:
- nucopCustom Cops
This gem provides the following custom cops:
Nucop/ExplicitFactoryBotUsage
Detects explicit usage of FactoryBot.create, FactoryGirl.build, etc. in spec files. The factory methods are globally available, so the explicit constant reference is unnecessary.
Nucop/NoCoreMethodOverrides
Detects method definitions that override Ruby/Rails core methods like blank?, present?, and empty?.
Nucop/NoWipSpecs
Detects specs tagged with :wip (work in progress) which should not be committed.
Nucop/ReleaseTogglesUseSymbols
Ensures that release toggle names are specified as symbols rather than strings.
Nucop/ShadowingFactoryBotCreationMethods
Detects method definitions in spec files that would shadow FactoryBot methods like create, build, build_list, etc.
Development
After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake to run the tests and RuboCop.
Publishing
To publish a new version:
- Update the version number in
lib/nucop/version.rb - Update
CHANGELOG.mdwith the changes - Commit the changes:
git add -A git commit -m "Bump version to X.X.X" - Release the gem (creates git tag, builds, and pushes to RubyGems):
bundle exec rake release
License
The gem is available as open source under the terms of the MIT License.