Skip to content

Commit 6b630e3

Browse files
authored
Merge pull request #127 from github/set-previously-undeclared-cops-to-enabled-false
config/default: Upstream cop disables since this is the central place
2 parents e8e89e0 + d959ddd commit 6b630e3

11 files changed

+107
-39
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: '/'
5+
versioning-strategy: increase
6+
schedule:
7+
interval: weekly

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
inherit_from:
22
- ./config/default.yml
3+
- ./config/rails.yml
34

45
Naming/FileName:
56
Enabled: true

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ If the Cop is **only applicable for GitHub**, then this is the right place to pr
2929

3030
## For Maintainers
3131

32+
### Updating Rubocop Dependencies
33+
34+
Rubocop regularly releases new versions with new cops. We want to keep up to date with the latest Rubocop releases, and keep these rules and styleguide in sync to reduce burden on consumers of this gem.
35+
36+
- Run `bundle update rubocop rubocop-performance rubocop-rails` to update the dependencies within this repository. Major updates will require updating the `.gemspec` file because of the pinned version constraints.
37+
- Run `bundle exec rubocop`, and copy the output of newly introduced rules into `config/default_pending.yml` and `config/rails_pending.yml`. They should look like this:
38+
39+
```sh
40+
Lint/DuplicateMagicComment: # new in 1.37
41+
Enabled: true
42+
Style/OperatorMethodCall: # new in 1.37
43+
Enabled: true
44+
Style/RedundantStringEscape: # new in 1.37
45+
Enabled: true
46+
```
47+
48+
- Run `bundle exec rubocop` again to ensure that it runs cleanly without any pending cops. Also run `bundle exec rake` to run the tests.
49+
- Work through the pending cops, and copy them to `config/{default,rails}.yml` with an explicity `Enabled: true` or `Enabled: false` depending on your decision as to whether they should be part of our standard ruleset.
50+
3251
### Releasing a new version
3352

3453
1. Update `rubocop-github.gemspec` with the next version number

Gemfile.lock

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ PATH
22
remote: .
33
specs:
44
rubocop-github (0.19.0)
5-
rubocop (>= 1.0.0)
6-
rubocop-performance
7-
rubocop-rails
5+
rubocop (>= 1.37)
6+
rubocop-performance (>= 1.15)
7+
rubocop-rails (>= 2.17)
88

99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
actionview (7.0.3)
13-
activesupport (= 7.0.3)
12+
actionview (7.0.4)
13+
activesupport (= 7.0.4)
1414
builder (~> 3.1)
1515
erubi (~> 1.4)
1616
rails-dom-testing (~> 2.0)
1717
rails-html-sanitizer (~> 1.1, >= 1.2.0)
18-
activesupport (7.0.3)
18+
activesupport (7.0.4)
1919
concurrent-ruby (~> 1.0, >= 1.0.2)
2020
i18n (>= 1.6, < 2)
2121
minitest (>= 5.1)
@@ -24,53 +24,55 @@ GEM
2424
builder (3.2.4)
2525
concurrent-ruby (1.1.10)
2626
crass (1.0.6)
27-
erubi (1.10.0)
28-
i18n (1.10.0)
27+
erubi (1.11.0)
28+
i18n (1.12.0)
2929
concurrent-ruby (~> 1.0)
30-
loofah (2.18.0)
30+
json (2.6.2)
31+
loofah (2.19.0)
3132
crass (~> 1.0.2)
3233
nokogiri (>= 1.5.9)
33-
minitest (5.16.1)
34-
nokogiri (1.13.6-arm64-darwin)
34+
minitest (5.16.3)
35+
nokogiri (1.13.9-arm64-darwin)
3536
racc (~> 1.4)
36-
nokogiri (1.13.6-x86_64-darwin)
37+
nokogiri (1.13.9-x86_64-darwin)
3738
racc (~> 1.4)
3839
parallel (1.22.1)
39-
parser (3.1.2.0)
40+
parser (3.1.2.1)
4041
ast (~> 2.4.1)
4142
racc (1.6.0)
42-
rack (2.2.3.1)
43+
rack (3.0.0)
4344
rails-dom-testing (2.0.3)
4445
activesupport (>= 4.2.0)
4546
nokogiri (>= 1.6)
4647
rails-html-sanitizer (1.4.3)
4748
loofah (~> 2.3)
4849
rainbow (3.1.1)
4950
rake (13.0.6)
50-
regexp_parser (2.5.0)
51+
regexp_parser (2.6.0)
5152
rexml (3.2.5)
52-
rubocop (1.31.0)
53+
rubocop (1.37.1)
54+
json (~> 2.3)
5355
parallel (~> 1.10)
54-
parser (>= 3.1.0.0)
56+
parser (>= 3.1.2.1)
5557
rainbow (>= 2.2.2, < 4.0)
5658
regexp_parser (>= 1.8, < 3.0)
5759
rexml (>= 3.2.5, < 4.0)
58-
rubocop-ast (>= 1.18.0, < 2.0)
60+
rubocop-ast (>= 1.23.0, < 2.0)
5961
ruby-progressbar (~> 1.7)
6062
unicode-display_width (>= 1.4.0, < 3.0)
61-
rubocop-ast (1.18.0)
63+
rubocop-ast (1.23.0)
6264
parser (>= 3.1.1.0)
63-
rubocop-performance (1.14.2)
65+
rubocop-performance (1.15.0)
6466
rubocop (>= 1.7.0, < 2.0)
6567
rubocop-ast (>= 0.4.0)
66-
rubocop-rails (2.15.1)
68+
rubocop-rails (2.17.2)
6769
activesupport (>= 4.2.0)
6870
rack (>= 1.1)
69-
rubocop (>= 1.7.0, < 2.0)
71+
rubocop (>= 1.33.0, < 2.0)
7072
ruby-progressbar (1.11.0)
71-
tzinfo (2.0.4)
73+
tzinfo (2.0.5)
7274
concurrent-ruby (~> 1.0)
73-
unicode-display_width (2.2.0)
75+
unicode-display_width (2.3.0)
7476

7577
PLATFORMS
7678
arm64-darwin-21
@@ -84,4 +86,4 @@ DEPENDENCIES
8486
rubocop-github!
8587

8688
BUNDLED WITH
87-
2.2.33
89+
2.3.24

config/default.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
inherit_from:
2+
- ./default_pending.yml
3+
14
require:
25
- rubocop-github
36
- rubocop-performance
@@ -446,6 +449,15 @@ Lint/EmptyConditionalBody:
446449
Lint/EmptyEnsure:
447450
Enabled: true
448451

452+
Lint/EmptyExpression:
453+
Enabled: false
454+
455+
Lint/EmptyFile:
456+
Enabled: false
457+
458+
Lint/EmptyWhen:
459+
Enabled: false
460+
449461
Lint/EmptyInterpolation:
450462
Enabled: true
451463

@@ -599,6 +611,9 @@ Lint/RegexpAsCondition:
599611
Lint/RequireParentheses:
600612
Enabled: true
601613

614+
Lint/RequireRangeParentheses:
615+
Enabled: false
616+
602617
Lint/RequireRelativeSelfPath:
603618
Enabled: false
604619

@@ -1120,6 +1135,9 @@ Style/EmptyCaseCondition:
11201135
Style/EmptyElse:
11211136
Enabled: false
11221137

1138+
Style/EmptyHeredoc:
1139+
Enabled: false
1140+
11231141
Style/EmptyLambdaParameter:
11241142
Enabled: false
11251143

@@ -1262,6 +1280,9 @@ Style/LambdaCall:
12621280
Style/LineEndConcatenation:
12631281
Enabled: false
12641282

1283+
Style/MagicCommentFormat:
1284+
Enabled: false
1285+
12651286
Style/MapCompactWithConditionalBlock:
12661287
Enabled: false
12671288

config/default_pending.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Lint/DuplicateMagicComment: # new in 1.37
2+
Enabled: false
3+
Style/OperatorMethodCall: # new in 1.37
4+
Enabled: false
5+
Style/RedundantStringEscape: # new in 1.37
6+
Enabled: false

config/rails.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
inherit_from:
2+
- ./rails_pending.yml
3+
14
require:
25
- rubocop-github-rails
36
- rubocop-rails

config/rails_cops.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ GitHub/RailsControllerRenderShorthand:
2222
Include:
2323
- 'app/controllers/**/*.rb'
2424

25-
GitHub/RailsRenderInline:
26-
Enabled: pending
27-
StyleGuide: https://github.com/github/rubocop-github/blob/main/guides/rails-controller-render-inline.md
28-
Include:
29-
- 'app/controllers/**/*.rb'
30-
- 'app/helpers/**/*.rb'
31-
- 'app/view_models/**/*.rb'
32-
- 'app/views/**/*.erb'
33-
3425
GitHub/RailsRenderObjectCollection:
3526
Enabled: pending
3627

config/rails_pending.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Rails/ActionControllerFlashBeforeRender: # new in 2.16
2+
Enabled: false
3+
Rails/ActionOrder: # new in 2.17
4+
Enabled: false
5+
Rails/ActiveSupportOnLoad: # new in 2.16
6+
Enabled: false
7+
Rails/FreezeTime: # new in 2.16
8+
Enabled: false
9+
Rails/IgnoredColumnsAssignment: # new in 2.17
10+
Enabled: false
11+
Rails/RootPathnameMethods: # new in 2.16
12+
Enabled: false
13+
Rails/ToSWithArgument: # new in 2.16
14+
Enabled: false
15+
Rails/TopLevelHashWithIndifferentAccess: # new in 2.16
16+
Enabled: false
17+
Rails/WhereMissing: # new in 2.16
18+
Enabled: false
19+
Rails/WhereNotWithMultipleConditions: # new in 2.17
20+
Enabled: false

lib/rubocop-github-rails.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
RuboCop::GitHub::Inject.rails_defaults!
88

9-
require "rubocop/cop/github/rails_application_record"
109
require "rubocop/cop/github/rails_controller_render_action_symbol"
1110
require "rubocop/cop/github/rails_controller_render_literal"
1211
require "rubocop/cop/github/rails_controller_render_paths_exist"
1312
require "rubocop/cop/github/rails_controller_render_shorthand"
14-
require "rubocop/cop/github/rails_render_inline"
1513
require "rubocop/cop/github/rails_render_object_collection"
1614
require "rubocop/cop/github/rails_view_render_literal"
1715
require "rubocop/cop/github/rails_view_render_paths_exist"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy