Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/github/rubocop-github
Code style checking for GitHub's Ruby projects
https://github.com/github/rubocop-github
rubocop ruby
Last synced: 27 days ago
JSON representation
Code style checking for GitHub's Ruby projects
- Host: GitHub
- URL: https://github.com/github/rubocop-github
- Owner: github
- License: mit
- Created: 2016-12-10T06:11:29.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T22:46:03.000Z (7 months ago)
- Last Synced: 2024-04-14T11:59:33.278Z (7 months ago)
- Topics: rubocop, ruby
- Language: Ruby
- Homepage:
- Size: 438 KB
- Stars: 628
- Watchers: 265
- Forks: 160
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-styleguides - https://github.com/github/rubocop-github
- awesome-list - rubocop-github
README
# RuboCop GitHub ![CI](https://github.com/github/rubocop-github/workflows/CI/badge.svg?event=push)
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](./STYLEGUIDE.md).
## Usage
Add `rubocop-github` to your Gemfile, along with its dependencies:
```ruby
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`:
```yaml
# .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:
```yaml
# .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](https://github.com/github/rubocop-rails-accessibility).
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](https://docs.rubocop.org/rubocop/configuration.html#enabled) 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
``` bash
bundle install
bundle exec rake test
```## The Cops
All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github).