rubocop-github 0.17.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -32
- data/STYLEGUIDE.md +208 -90
- data/config/default.yml +1657 -2
- data/config/default_cops.yml +3 -0
- data/config/rails.yml +414 -2
- data/config/{_rails_shared.yml → rails_cops.yml} +10 -68
- data/lib/rubocop/cop/github/insecure_hash_algorithm.rb +1 -1
- data/lib/rubocop/cop/github/rails_application_record.rb +2 -2
- data/lib/rubocop/cop/github/rails_controller_render_action_symbol.rb +11 -5
- data/lib/rubocop/cop/github/rails_controller_render_literal.rb +7 -7
- data/lib/rubocop/cop/github/rails_controller_render_paths_exist.rb +4 -4
- data/lib/rubocop/cop/github/rails_controller_render_shorthand.rb +4 -11
- data/lib/rubocop/cop/github/rails_render_inline.rb +2 -2
- data/lib/rubocop/cop/github/rails_render_object_collection.rb +3 -3
- data/lib/rubocop/cop/github/rails_view_render_literal.rb +6 -6
- data/lib/rubocop/cop/github/rails_view_render_paths_exist.rb +3 -3
- data/lib/rubocop/cop/github/rails_view_render_shorthand.rb +3 -3
- 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 +18 -0
- data/lib/rubocop-github.rb +9 -0
- metadata +15 -15
- data/config/_default_shared.yml +0 -329
- data/config/default_deprecated.yml +0 -4
- data/config/default_edge.yml +0 -4
- data/config/rails_deprecated.yml +0 -7
- data/config/rails_edge.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e2de9cd12a2e6dc23c4ab4af442fa0989b99c0b2f775300ea9137aa1d569591
|
4
|
+
data.tar.gz: eede5dc50f6f7fdf7fd4d05cede6b70a989e97c2c2df18420b97fefd8997782e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8fc315cb6296196a0c3358990e2d5338217afcfbad7fc78a3dd636a52c32d3da2e2566906788fc8cf9818d3543d9939a59e431c3d7dc48eb105d58a8cb63f1e
|
7
|
+
data.tar.gz: da8ea70e7537cf46b80ccd81804bdbc407c45822a727c0715e571dc19f2706416ddefd6d1504da0f1a67254c4ef99bfdecc5054732eabbf1571a07a39d9c87e9
|
data/README.md
CHANGED
@@ -4,50 +4,49 @@ This repository provides recommended RuboCop configuration and additional Cops f
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
|
7
|
+
Add `rubocop-github` to your Gemfile, along with its dependencies:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
```ruby
|
10
|
+
gem "rubocop-github", require: false
|
11
|
+
gem "rubocop-performance", require: false
|
12
|
+
gem "rubocop-rails", require: false
|
13
|
+
```
|
12
14
|
|
13
|
-
|
14
|
-
gem "rubocop", "< 0.68"
|
15
|
-
gem "rubocop-github"
|
16
|
-
```
|
15
|
+
Inherit all of the stylistic rules and cops through an inheritance declaration in your `.rubocop.yml`:
|
17
16
|
|
18
|
-
|
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
|
+
```
|
19
24
|
|
20
|
-
|
21
|
-
inherit_gem:
|
22
|
-
rubocop-github:
|
23
|
-
- config/default.yml
|
24
|
-
- config/rails.yml
|
25
|
-
```
|
25
|
+
Alternatively, only require the additional custom cops in your `.rubocop.yml` without inheriting/enabling the other stylistic rules:
|
26
26
|
|
27
|
-
|
27
|
+
```yaml
|
28
|
+
# .rubocop.yml
|
29
|
+
require:
|
30
|
+
- rubocop-github # generic Ruby cops only
|
31
|
+
- rubocop-github-rails # Rails-specific cops only
|
32
|
+
```
|
28
33
|
|
29
|
-
|
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).
|
30
35
|
|
31
|
-
|
32
|
-
gem "rubocop-github"
|
33
|
-
gem "rubocop-performance", require: false
|
34
|
-
gem "rubocop-rails", require: false
|
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.
|
36
37
|
|
37
|
-
|
38
|
+
### Legacy usage
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
rubocop-github:
|
42
|
-
- config/default_edge.yml
|
43
|
-
- config/rails_edge.yml
|
44
|
-
```
|
40
|
+
If you are using a rubocop version < 1.0.0, you can use rubocop-github version
|
41
|
+
0.16.2 (see the README from that version for more details).
|
45
42
|
|
46
43
|
## Testing
|
47
44
|
|
48
|
-
|
49
|
-
|
45
|
+
``` bash
|
46
|
+
bundle install
|
47
|
+
bundle exec rake test
|
48
|
+
```
|
50
49
|
|
51
50
|
## The Cops
|
52
51
|
|
53
|
-
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).
|