gc_ruboconfig
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
Installation
Add this line to your application's Gemfile:
gem 'gc_ruboconfig'Then execute:
bundle installThe following Rubocop plugins will be automatically installed as dependencies:
-
rubocop- Core Ruby linting -
rubocop-rspec- RSpec-specific rules -
rubocop-rails- Rails-specific rules -
rubocop-performance- Performance-focused rules -
rubocop-factory_bot- Factory Bot-specific rules -
rubocop-rspec_rails- RSpec Rails integration rules
Usage
Basic Setup
Create a .rubocop.yml file in your project root and inherit from this gem:
inherit_gem:
gc_ruboconfig: rubocop.ymlRails Projects
For Rails applications, also inherit the Rails-specific configuration:
inherit_gem:
gc_ruboconfig:
- rubocop.yml
- rails.ymlCapybara Testing
If you're using Capybara for integration testing, include the Capybara configuration:
inherit_gem:
gc_ruboconfig:
- rubocop.yml
- rails.yml
- capybara.ymlSorbet Projects
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-sorbetContributing
We welcome contributions! See CONTRIBUTING.md for guidelines on contributing to this project.
Versioning
This gem follows semantic versioning. Breaking changes to Rubocop rules will result in a major version bump.
License
The gem is available as open source under the terms of the Apache License 2.0.
Release Process
Releases are automated through GitHub Actions:
- Update the version in
gc_ruboconfig.gemspec - Update
CHANGELOG.mdwith the changes - Create a tagged release on GitHub
- The gem will be automatically built and published to RubyGems