No description
  • Ruby 99.8%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-15 12:47:02 +01:00
.github Bump ruby/setup-ruby from 1.316.0 to 1.317.0 2026-07-14 19:52:39 +00:00
config Complete RuboCop style guide links 2026-07-14 02:09:54 +08:00
guides Replace custom RailsApplicationRecord and RailsRenderInline cops with their upstream equivalent 2022-10-13 13:41:13 -07:00
lib wire up UnreliableSubclasses cop 2026-06-20 16:11:00 +02:00
script Automated Releases (#252) 2025-02-21 10:33:45 -08:00
test add UnreliableSubclasses cop with tests 2026-06-20 15:23:00 +02:00
.gitignore Fix deprecated Naming/PredicateName cop - rename to Naming/PredicatePrefix 2025-06-05 23:12:56 +00:00
.rubocop.yml Switch Gemspec/DevelopmentDependencies to gemspec 2024-05-17 21:11:45 +00:00
.ruby-version use the latest available version of ruby 2025-02-24 14:18:56 -08:00
CHANGELOG.md document UnreliableSubclasses in styleguide and changelog 2026-06-20 18:14:00 +02:00
CODE_OF_CONDUCT.md Add Contribution instructions, code of conduct, and codeowners 2022-10-13 14:03:21 -07:00
CONTRIBUTING.md docs 2025-05-27 09:46:22 -07:00
Gemfile Fix for RuboCop 2018-09-13 09:58:59 -04:00
Gemfile.lock Bump rubocop-rails from 2.35.5 to 2.36.0 2026-07-13 19:52:23 +00:00
LICENSE Add LICENSE 2016-12-09 22:22:37 -08:00
Rakefile Fix for RuboCop 2018-09-13 09:58:59 -04:00
README.md Automated Releases (#252) 2025-02-21 10:33:45 -08:00
rubocop-github.gemspec Bump the bundler group across 1 directory with 2 updates 2026-03-24 21:17:39 +00:00
STYLEGUIDE.md Complete RuboCop style guide links 2026-07-14 02:09:54 +08:00

RuboCop GitHub

test build lint release

This repository provides recommended RuboCop configuration and additional Cops for use on GitHub open source and internal Ruby projects, and is the home of GitHub's Ruby Style Guide.

Usage

Add rubocop-github to your Gemfile, along with its dependencies:

gem "rubocop-github", require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false

Inherit all of the stylistic rules and cops through an inheritance declaration in your .rubocop.yml:

# .rubocop.yml
inherit_gem:
  rubocop-github:
  - config/default.yml # generic Ruby rules and cops
  - config/rails.yml # Rails-specific rules and cops

Alternatively, only require the additional custom cops in your .rubocop.yml without inheriting/enabling the other stylistic rules:

# .rubocop.yml
require:
  - rubocop-github  # generic Ruby cops only
  - rubocop-github-rails # Rails-specific cops only

💭 Looking for config/accessibility.yml and the GitHub/Accessibility configs? They have been moved to a new gem.

For more granular control over which of RuboCop's rules are enabled for your project, both from this gem and your own configs, consider using the DisabledByDefault: true option under AllCops in your project's .rubocop.yml file. This will disable all cops by default, and you can then explicitly enable the ones you want by setting Enabled: true. See the RuboCop docs for more information.

Legacy usage

If you are using a rubocop version < 1.0.0, you can use rubocop-github version 0.16.2 (see the README from that version for more details).

Testing

bundle install
bundle exec rake test

The Cops

All cops are located under lib/rubocop/cop/github.