Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Code style checking for GitHub's Ruby projects

License

NotificationsYou must be signed in to change notification settings

github/rubocop-github

Repository files navigation

testbuildlintrelease

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

Usage

Addrubocop-github to your Gemfile, along with its dependencies:

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

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

# .rubocop.ymlinherit_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.ymlrequire:  -rubocop-github# generic Ruby cops only  -rubocop-github-rails# Rails-specific cops only

💭 Looking forconfig/accessibility.yml and theGitHub/Accessibility configs? They have been moved toa 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 theDisabledByDefault: true option underAllCops 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 settingEnabled: true. Seethe RuboCop docs for more information.

Legacy usage

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

Testing

bundle installbundleexec raketest

The Cops

All cops are located underlib/rubocop/cop/github.


[8]ページ先頭

©2009-2025 Movatter.jp