You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Unset `DisabledByDefault: true` in `config/default.yml`. Prevents confusing behaviour where users of the gem didn't realise that RuboCop's default cops weren't being applied (including potentially custom cops in their projects). We've explicitly set `Enabled: false` for all the cops that were previously default disabled. This has the effect that consumers of this gem won't be surprised by new linting violations when they use this new version in their projects. (https://github.com/github/rubocop-github/pull/119)
Copy file name to clipboardExpand all lines: README.md
+26-14Lines changed: 26 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,37 @@ This repository provides recommended RuboCop configuration and additional Cops f
4
4
5
5
## Usage
6
6
7
-
**Gemfile**
7
+
Add `rubocop-github` to your Gemfile, along with its dependencies:
8
8
9
-
```ruby
10
-
gem "rubocop-github"
11
-
gem "rubocop-performance", require:false
12
-
gem "rubocop-rails", require:false
13
-
```
9
+
```ruby
10
+
gem "rubocop-github", require:false
11
+
gem "rubocop-performance", require:false
12
+
gem "rubocop-rails", require:false
13
+
```
14
14
15
-
**.rubocop.yml**
15
+
Inherit all of the stylistic rules and cops through an inheritance declaration in your `.rubocop.yml`:
16
16
17
-
```yaml
18
-
inherit_gem:
19
-
rubocop-github:
20
-
- config/default.yml
21
-
- config/rails.yml
22
-
```
17
+
```yaml
18
+
# .rubocop.yml
19
+
inherit_from:
20
+
rubocop-github:
21
+
- config/default.yml # generic Ruby rules and cops
22
+
- config/rails.yml # Rails-specific rules and cops
23
+
```
24
+
25
+
Alternatively, only require the additional custom cops in your `.rubocop.yml` without inheriting/enabling the other stylistic rules:
26
+
27
+
```yaml
28
+
# .rubocop.yml
29
+
require:
30
+
- rubocop-github # generic Ruby cops only
31
+
- rubocop-github-rails # Rails-specific cops only
32
+
```
23
33
24
34
💭 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).
25
35
36
+
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.
37
+
26
38
### Legacy usage
27
39
28
40
If you are using a rubocop version < 1.0.0, you can use rubocop-github version
@@ -37,4 +49,4 @@ bundle exec rake test
37
49
38
50
## The Cops
39
51
40
-
All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github) and [`lib/rubocop/cop/github/accessibility`](lib/rubocop/cop/github/accessibility), and contain examples/documentation.
52
+
All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github).
Copy file name to clipboardExpand all lines: STYLEGUIDE.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -418,9 +418,8 @@ hsh = {
418
418
[Keyword arguments](http://magazine.rubyist.net/?Ruby200SpecialEn-kwarg) are recommended but not required when a method's arguments may otherwise be opaque or non-obvious when called. Additionally, prefer them over the old "Hash as pseudo-named args" style from pre-2.0 ruby.
0 commit comments