Skip to content

Commit d533765

Browse files
committed
Branch configs for incompatible changes
1 parent 3b29ee8 commit d533765

10 files changed

+498
-453
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
This repository provides recommended RuboCop configuration and additional Cops for use on GitHub open source and internal Ruby projects.
44

5-
## Installation
5+
## Usage
6+
7+
Rubocop 0.68 removed performance cops and 0.72 removed Rails cops. However, upgrading `rubocop-github` without modification will almost definitely create very many new offenses. The current version of this gem exposes the "legacy" configuration under `config/default.yml` and `config/rails.yml` which should be used *if and only if* the version of rubocop is locked to `< 0.68` in your project (which it should be unless you `bundle update rubocop`). It also exposes an "edge" configuration under `config/default_edge.yml` and `config/rails_edge.yml` so that the changes can be tested without introducing breaking changes.
8+
9+
### Legacy usage
610

711
**Gemfile**
812

913
``` ruby
14+
gem "rubocop", "< 0.68"
1015
gem "rubocop-github"
1116
```
1217

@@ -19,6 +24,25 @@ inherit_gem:
1924
- config/rails.yml
2025
```
2126
27+
### Edge usage
28+
29+
**Gemfile**
30+
31+
``` ruby
32+
gem "rubocop-github"
33+
gem "rubocop-performance", require: false
34+
gem "rubocop-rails", require: false
35+
```
36+
37+
**.rubocop.yml**
38+
39+
``` yaml
40+
inherit_gem:
41+
rubocop-github:
42+
- config/default_edge.yml
43+
- config/rails_edge.yml
44+
```
45+
2246
## Testing
2347
2448
`bundle install`

config/_default_shared.yml

Lines changed: 325 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,325 @@
1+
require: rubocop/cop/github
2+
3+
# These cops are compatible across supported versions of rubocop
4+
5+
Bundler/DuplicatedGem:
6+
Enabled: true
7+
8+
Bundler/OrderedGems:
9+
Enabled: true
10+
11+
Layout/BlockAlignment:
12+
Enabled: true
13+
14+
Layout/BlockEndNewline:
15+
Enabled: true
16+
17+
Layout/ConditionPosition:
18+
Enabled: true
19+
20+
Layout/DefEndAlignment:
21+
Enabled: true
22+
23+
Layout/EndAlignment:
24+
Enabled: false
25+
26+
Layout/EndOfLine:
27+
Enabled: true
28+
29+
Layout/InitialIndentation:
30+
Enabled: true
31+
32+
Layout/SpaceAfterColon:
33+
Enabled: true
34+
35+
Layout/SpaceAfterComma:
36+
Enabled: true
37+
38+
Layout/SpaceAfterMethodName:
39+
Enabled: true
40+
41+
Layout/SpaceAfterNot:
42+
Enabled: true
43+
44+
Layout/SpaceAfterSemicolon:
45+
Enabled: true
46+
47+
Layout/SpaceAroundBlockParameters:
48+
Enabled: true
49+
50+
Layout/SpaceAroundEqualsInParameterDefault:
51+
Enabled: true
52+
53+
Layout/SpaceBeforeBlockBraces:
54+
Enabled: true
55+
56+
Layout/SpaceInsideArrayLiteralBrackets:
57+
Enabled: true
58+
EnforcedStyle: no_space
59+
60+
Layout/SpaceInsideArrayPercentLiteral:
61+
Enabled: true
62+
63+
Layout/SpaceInsideBlockBraces:
64+
Enabled: true
65+
66+
Layout/SpaceInsideParens:
67+
Enabled: true
68+
69+
Layout/SpaceInsideRangeLiteral:
70+
Enabled: true
71+
72+
Layout/SpaceInsideReferenceBrackets:
73+
Enabled: true
74+
75+
Layout/Tab:
76+
Enabled: true
77+
78+
Layout/TrailingBlankLines:
79+
Enabled: true
80+
81+
Layout/TrailingWhitespace:
82+
Enabled: true
83+
84+
Lint/CircularArgumentReference:
85+
Enabled: true
86+
87+
Lint/Debugger:
88+
Enabled: true
89+
90+
Lint/DeprecatedClassMethods:
91+
Enabled: true
92+
93+
Lint/DuplicateMethods:
94+
Enabled: true
95+
96+
Lint/DuplicatedKey:
97+
Enabled: true
98+
99+
Lint/EachWithObjectArgument:
100+
Enabled: true
101+
102+
Lint/ElseLayout:
103+
Enabled: true
104+
105+
Lint/EmptyEnsure:
106+
Enabled: true
107+
108+
Lint/EmptyInterpolation:
109+
Enabled: true
110+
111+
Lint/EndInMethod:
112+
Enabled: true
113+
114+
Lint/EnsureReturn:
115+
Enabled: true
116+
117+
Lint/FlipFlop:
118+
Enabled: true
119+
120+
Lint/FloatOutOfRange:
121+
Enabled: true
122+
123+
Lint/FormatParameterMismatch:
124+
Enabled: true
125+
126+
Lint/LiteralAsCondition:
127+
Enabled: true
128+
129+
Lint/LiteralInInterpolation:
130+
Enabled: true
131+
132+
Lint/Loop:
133+
Enabled: true
134+
135+
Lint/NextWithoutAccumulator:
136+
Enabled: true
137+
138+
Lint/RandOne:
139+
Enabled: true
140+
141+
Lint/RequireParentheses:
142+
Enabled: true
143+
144+
Lint/RescueException:
145+
Enabled: true
146+
147+
Lint/StringConversionInInterpolation:
148+
Enabled: true
149+
150+
Lint/UnderscorePrefixedVariableName:
151+
Enabled: true
152+
153+
Lint/UnneededCopDisableDirective:
154+
Enabled: true
155+
156+
Lint/UnneededSplatExpansion:
157+
Enabled: true
158+
159+
Lint/UnreachableCode:
160+
Enabled: true
161+
162+
Lint/UselessComparison:
163+
Enabled: true
164+
165+
Lint/UselessSetterCall:
166+
Enabled: true
167+
168+
Lint/Void:
169+
Enabled: true
170+
171+
Metrics/AbcSize:
172+
Enabled: false
173+
174+
Metrics/BlockLength:
175+
Enabled: false
176+
177+
Metrics/BlockNesting:
178+
Enabled: false
179+
180+
Metrics/ClassLength:
181+
Enabled: false
182+
183+
Metrics/CyclomaticComplexity:
184+
Enabled: false
185+
186+
Metrics/LineLength:
187+
Enabled: false
188+
189+
Metrics/MethodLength:
190+
Enabled: false
191+
192+
Metrics/ModuleLength:
193+
Enabled: false
194+
195+
Metrics/ParameterLists:
196+
Enabled: false
197+
198+
Metrics/PerceivedComplexity:
199+
Enabled: false
200+
201+
Naming/AsciiIdentifiers:
202+
Enabled: true
203+
204+
Naming/ClassAndModuleCamelCase:
205+
Enabled: true
206+
207+
Naming/FileName:
208+
Enabled: true
209+
210+
Naming/MethodName:
211+
Enabled: true
212+
213+
Performance/CaseWhenSplat:
214+
Enabled: false
215+
216+
Performance/Count:
217+
Enabled: true
218+
219+
Performance/Detect:
220+
Enabled: true
221+
222+
Performance/DoubleStartEndWith:
223+
Enabled: true
224+
225+
Performance/EndWith:
226+
Enabled: true
227+
228+
Performance/FlatMap:
229+
Enabled: true
230+
231+
Performance/RangeInclude:
232+
Enabled: false
233+
234+
Performance/RedundantMatch:
235+
Enabled: false
236+
237+
Performance/RedundantMerge:
238+
Enabled: true
239+
MaxKeyValuePairs: 1
240+
241+
Performance/ReverseEach:
242+
Enabled: true
243+
244+
Performance/Size:
245+
Enabled: true
246+
247+
Performance/StartWith:
248+
Enabled: true
249+
250+
Security/Eval:
251+
Enabled: true
252+
253+
Style/ArrayJoin:
254+
Enabled: true
255+
256+
Style/BeginBlock:
257+
Enabled: true
258+
259+
Style/BlockComments:
260+
Enabled: true
261+
262+
Style/CaseEquality:
263+
Enabled: true
264+
265+
Style/CharacterLiteral:
266+
Enabled: true
267+
268+
Style/ClassMethods:
269+
Enabled: true
270+
271+
Style/Copyright:
272+
Enabled: false
273+
274+
Style/DefWithParentheses:
275+
Enabled: true
276+
277+
Style/EndBlock:
278+
Enabled: true
279+
280+
Style/For:
281+
Enabled: true
282+
283+
Style/FrozenStringLiteralComment:
284+
Enabled: true
285+
286+
Style/HashSyntax:
287+
Enabled: true
288+
EnforcedStyle: ruby19_no_mixed_keys
289+
290+
Style/LambdaCall:
291+
Enabled: true
292+
293+
Style/MethodCallWithoutArgsParentheses:
294+
Enabled: true
295+
296+
Style/MethodDefParentheses:
297+
Enabled: true
298+
299+
Style/MultilineIfThen:
300+
Enabled: true
301+
302+
Style/NilComparison:
303+
Enabled: true
304+
305+
Style/Not:
306+
Enabled: true
307+
308+
Style/OneLineConditional:
309+
Enabled: true
310+
311+
Style/RedundantSortBy:
312+
Enabled: true
313+
314+
Style/Sample:
315+
Enabled: true
316+
317+
Style/StabbyLambdaParentheses:
318+
Enabled: true
319+
320+
Style/Strip:
321+
Enabled: true
322+
323+
Style/StringLiterals:
324+
Enabled: true
325+
EnforcedStyle: double_quotes

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