Code style checking for GitHub's Ruby projects
Перейти к файлу
dependabot[bot] 6fcff2d3c2
Bump ruby/setup-ruby from 1.200.0 to 1.202.0 (#209)
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.200.0 to 1.202.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](217c988b8c...a2bbe5b1b2)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 11:49:56 -08:00
.github Bump ruby/setup-ruby from 1.200.0 to 1.202.0 (#209) 2024-11-18 11:49:56 -08:00
config Default pendng to false 2024-05-17 21:13:54 +00:00
guides Replace custom `RailsApplicationRecord` and `RailsRenderInline` cops with their upstream equivalent 2022-10-13 13:41:13 -07:00
lib Just use a single message 2024-07-17 16:54:09 +02:00
test Make line length reasonable 2024-07-17 16:58:00 +02:00
.gitignore Add Gemfile.lock to version control 2022-01-14 16:17:10 -05:00
.rubocop.yml Switch Gemspec/DevelopmentDependencies to gemspec 2024-05-17 21:11:45 +00:00
.ruby-version Add Ruby 3.2 to test matrix; add .ruby-version; ensure Rubocop::Config is passed to test helper 2023-03-24 10:08:12 -07:00
CHANGELOG.md Update CHANGELOG.md 2024-02-12 14:22:43 -06:00
CODEOWNERS Update codeowners to `rubocop-reviewers` 2023-03-24 10:17:42 -07:00
CODE_OF_CONDUCT.md Add Contribution instructions, code of conduct, and codeowners 2022-10-13 14:03:21 -07:00
CONTRIBUTING.md Pin versions, add Dependabot rules, update rubocop versions and create pending files 2022-10-28 10:17:54 -07:00
Gemfile Fix for RuboCop 2018-09-13 09:58:59 -04:00
Gemfile.lock Bump rubocop-performance from 1.22.1 to 1.23.0 (#210) 2024-11-18 11:49:35 -08:00
LICENSE Add LICENSE 2016-12-09 22:22:37 -08:00
README.md Fix usage documentation for Inheriting all of the stylistic rules and cops 2022-12-05 12:01:37 +00:00
Rakefile Fix for RuboCop 2018-09-13 09:58:59 -04:00
STYLEGUIDE.md STYLEGUIDE: `UnusedBlockArgument` is in `Lint` not `Style` 2022-10-27 12:16:15 +01:00
rubocop-github.gemspec Set required_ruby_version to 3 2024-02-12 14:09:45 -06:00

README.md

RuboCop GitHub CI

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.