rubocop-github 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +33 -17
- data/STYLEGUIDE.md +395 -92
- data/config/default.yml +1400 -46
- data/config/default_cops.yml +3 -0
- data/config/default_pending.yml +6 -0
- data/config/rails.yml +364 -80
- data/config/rails_cops.yml +50 -0
- data/config/rails_pending.yml +20 -0
- data/lib/rubocop/cop/github/rails_view_render_shorthand.rb +8 -2
- data/lib/rubocop/cop/github.rb +2 -11
- data/lib/rubocop/github/inject.rb +27 -0
- data/lib/rubocop/github.rb +9 -0
- data/lib/rubocop-github-rails.rb +16 -0
- data/lib/rubocop-github.rb +9 -0
- metadata +17 -12
- data/guides/rails-render-inline.md +0 -27
- data/lib/rubocop/cop/github/rails_application_record.rb +0 -29
- data/lib/rubocop/cop/github/rails_render_inline.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d23c4950774e5fe3dd1dea8eb07c44ab795b16987b3915eb50456cb9d4826ad3
|
4
|
+
data.tar.gz: 2003404eb801cc43c6ef0a7625f4536e334503577dafaa26d0ecaa3a0ea873e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105a5f9824d72e61041aae7559753e008e4337cf3a1d2a0b646e649647bbf42d8ded35d1a495a757500c02de31e9d44aeef4e25476c5a0b10b045c5712ef893d
|
7
|
+
data.tar.gz: bd5d04dd886cf8804834fea5128036dc601d02c4f984c50e3f485ccf2bc8da329f27eda1a0ad0c088556fc4857c88d71f8a3a020b67176af99a562ed2d4eb5ca
|
data/README.md
CHANGED
@@ -1,25 +1,39 @@
|
|
1
1
|
# RuboCop GitHub 
|
2
2
|
|
3
|
-
This repository provides recommended RuboCop configuration and additional Cops for use on GitHub open source and internal Ruby projects.
|
3
|
+
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).
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
|
7
|
+
Add `rubocop-github` to your Gemfile, along with its dependencies:
|
8
8
|
|
9
|
-
```
|
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
|
-
|
15
|
+
Inherit all of the stylistic rules and cops through an inheritance declaration in your `.rubocop.yml`:
|
16
16
|
|
17
|
-
```
|
18
|
-
|
19
|
-
|
20
|
-
-
|
21
|
-
|
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
|
+
```
|
33
|
+
|
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).
|
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.
|
23
37
|
|
24
38
|
### Legacy usage
|
25
39
|
|
@@ -28,9 +42,11 @@ If you are using a rubocop version < 1.0.0, you can use rubocop-github version
|
|
28
42
|
|
29
43
|
## Testing
|
30
44
|
|
31
|
-
|
32
|
-
|
45
|
+
``` bash
|
46
|
+
bundle install
|
47
|
+
bundle exec rake test
|
48
|
+
```
|
33
49
|
|
34
50
|
## The Cops
|
35
51
|
|
36
|
-
All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github)
|
52
|
+
All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github).
|