GoCardless's shared Rubocop configuration, conforming to our house style.
This gem provides a comprehensive set of Ruby style guidelines and linting rules, including support for:
- Core Ruby best practices
- RSpec testing conventions
- Rails application patterns
- Performance optimizations
- Factory Bot usage
Add this line to your application's Gemfile:
gem 'gc_ruboconfig'
Then execute:
bundle install
The following Rubocop plugins will be automatically installed as dependencies:
rubocop
- Core Ruby lintingrubocop-rspec
- RSpec-specific rulesrubocop-rails
- Rails-specific rulesrubocop-performance
- Performance-focused rulesrubocop-factory_bot
- Factory Bot-specific rulesrubocop-rspec_rails
- RSpec Rails integration rules
Create a .rubocop.yml
file in your project root and inherit from this gem:
inherit_gem:
gc_ruboconfig: rubocop.yml
For Rails applications, also inherit the Rails-specific configuration:
inherit_gem:
gc_ruboconfig:
- rubocop.yml
- rails.yml
If you're using Capybara for integration testing, include the Capybara configuration:
inherit_gem:
gc_ruboconfig:
- rubocop.yml
- rails.yml
- capybara.yml
For projects using Sorbet, you'll need to add rubocop-sorbet
separately as it's not included in this gem:
# Gemfile
gem 'gc_ruboconfig'
gem 'rubocop-sorbet'
# .rubocop.yml
inherit_gem:
gc_ruboconfig: rubocop.yml
plugins:
- rubocop-sorbet
We welcome contributions! See CONTRIBUTING.md for guidelines on contributing to this project.
This gem follows semantic versioning. Breaking changes to Rubocop rules will result in a major version bump.
The gem is available as open source under the terms of the Apache License 2.0.
Releases are automated through GitHub Actions:
- Update the version in
gc_ruboconfig.gemspec
- Update
CHANGELOG.md
with the changes - Create a tagged release on GitHub
- The gem will be automatically built and published to RubyGems