Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit ed64d5d

Browse files
authored
Updates rubocop.yml (#35)
1 parent d58fccf commit ed64d5d

1 file changed

Lines changed: 65 additions & 49 deletions

File tree

.rubocop.yml

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
11
AllCops:
2-
TargetRubyVersion: 2.3
2+
TargetRubyVersion: 2.5
33
Exclude:
44
- vendor/**/*
5-
- db/schema.rb
65

7-
Style/AccessorMethodName:
6+
Naming/AccessorMethodName:
87
Description: Check the naming of accessor methods for get_/set_.
98
Enabled: false
109

10+
Naming/AsciiIdentifiers:
11+
Description: 'Use only ascii symbols in identifiers.'
12+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
13+
Enabled: false
14+
15+
Naming/FileName:
16+
Description: 'Use snake_case for source file names.'
17+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
18+
Enabled: false
19+
20+
Naming/BinaryOperatorParameterName:
21+
Description: 'When defining binary operators, name the argument other.'
22+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
23+
Enabled: false
24+
25+
Naming/MemoizedInstanceVariableName:
26+
Description: Memoized method name should match memo instance variable name.
27+
Enabled: true
28+
EnforcedStyleForLeadingUnderscores: required
29+
30+
Naming/PredicateName:
31+
Description: 'Check the names of predicate methods.'
32+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
33+
NamePrefix:
34+
- is_
35+
- has_
36+
- have_
37+
NamePrefixBlacklist:
38+
- is_
39+
Exclude:
40+
- spec/**/*
41+
1142
Style/Alias:
1243
Description: 'Use alias_method instead of alias.'
1344
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
@@ -23,11 +54,6 @@ Style/AsciiComments:
2354
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
2455
Enabled: false
2556

26-
Style/AsciiIdentifiers:
27-
Description: 'Use only ascii symbols in identifiers.'
28-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
29-
Enabled: false
30-
3157
Style/Attr:
3258
Description: 'Checks for uses of Module#attr.'
3359
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
@@ -107,11 +133,6 @@ Style/EvenOdd:
107133
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
108134
Enabled: false
109135

110-
Style/FileName:
111-
Description: 'Use snake_case for source file names.'
112-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
113-
Enabled: false
114-
115136
Style/FlipFlop:
116137
Description: 'Checks for flip flops'
117138
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
@@ -139,7 +160,6 @@ Style/IfUnlessModifier:
139160
single-line body.
140161
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
141162
Enabled: false
142-
MaxLineLength: 80
143163

144164
Style/IfWithSemicolon:
145165
Description: 'Do not use if x; .... Use the ternary operator instead.'
@@ -150,6 +170,10 @@ Style/InlineComment:
150170
Description: 'Avoid inline comments.'
151171
Enabled: false
152172

173+
Style/IpAddresses:
174+
Description: "Don't include literal IP addresses in code."
175+
Enabled: true
176+
153177
Style/Lambda:
154178
Description: 'Use the new lambda literal syntax for single-line blocks.'
155179
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
@@ -217,11 +241,6 @@ Style/OneLineConditional:
217241
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
218242
Enabled: false
219243

220-
Style/OpMethod:
221-
Description: 'When defining binary operators, name the argument other.'
222-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
223-
Enabled: false
224-
225244
Style/PercentLiteralDelimiters:
226245
Description: 'Use `%`-literal delimiters consistently'
227246
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
@@ -232,18 +251,6 @@ Style/PerlBackrefs:
232251
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
233252
Enabled: false
234253

235-
Style/PredicateName:
236-
Description: 'Check the names of predicate methods.'
237-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
238-
NamePrefix:
239-
- is_
240-
- has_
241-
- have_
242-
NamePrefixBlacklist:
243-
- is_
244-
Exclude:
245-
- spec/**/*
246-
247254
Style/Proc:
248255
Description: 'Use proc instead of Proc.new.'
249256
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
@@ -315,8 +322,18 @@ Style/TrailingCommaInArguments:
315322
- no_comma
316323
Enabled: true
317324

318-
Style/TrailingCommaInLiteral:
319-
Description: 'Checks for trailing comma in array and hash literals.'
325+
Style/TrailingCommaInArrayLiteral:
326+
Description: 'Checks for trailing comma in array literals.'
327+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
328+
EnforcedStyleForMultiline: comma
329+
SupportedStylesForMultiline:
330+
- comma
331+
- consistent_comma
332+
- no_comma
333+
Enabled: true
334+
335+
Style/TrailingCommaInHashLiteral:
336+
Description: 'Checks for trailing comma in hash literals.'
320337
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
321338
EnforcedStyleForMultiline: comma
322339
SupportedStylesForMultiline:
@@ -366,6 +383,13 @@ Style/OptionHash:
366383

367384
# Layout
368385

386+
Layout/ConditionPosition:
387+
Description: >-
388+
Checks for condition placed in a confusing position relative to
389+
the keyword.
390+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
391+
Enabled: false
392+
369393
Layout/DotPosition:
370394
Description: 'Checks the position of the dot in multi-line method calls.'
371395
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
@@ -439,14 +463,7 @@ Lint/AssignmentInCondition:
439463

440464
Lint/CircularArgumentReference:
441465
Description: "Don't refer to the keyword argument in the default value."
442-
Enabled: false
443-
444-
Lint/ConditionPosition:
445-
Description: >-
446-
Checks for condition placed in a confusing position relative to
447-
the keyword.
448-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
449-
Enabled: false
466+
Enabled: true
450467

451468
Lint/DeprecatedClassMethods:
452469
Description: 'Check for deprecated class method calls.'
@@ -473,13 +490,7 @@ Lint/HandleExceptions:
473490
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
474491
Enabled: false
475492

476-
Lint/InvalidCharacterLiteral:
477-
Description: >-
478-
Checks for invalid character literals with a non-escaped
479-
whitespace character.
480-
Enabled: false
481-
482-
Lint/LiteralInCondition:
493+
Lint/LiteralAsCondition:
483494
Description: 'Checks of literals used in conditions.'
484495
Enabled: false
485496

@@ -520,7 +531,7 @@ Lint/UnderscorePrefixedVariableName:
520531
Description: 'Do not use prefix `_` for a variable that is used.'
521532
Enabled: false
522533

523-
Lint/UnneededDisable:
534+
Lint/UnneededCopDisableDirective:
524535
Description: >-
525536
Checks for rubocop:disable comments that can be removed.
526537
Note: this cop is not disabled when disabling all cops.
@@ -543,6 +554,7 @@ Metrics/BlockLength:
543554
Description: 'Avoid long blocks with many lines.'
544555
Enabled: true
545556
Exclude:
557+
- "gems/**/*_spec.rb"
546558
- "spec/**/*"
547559
- "config/routes.rb"
548560

@@ -636,6 +648,10 @@ Performance/StringReplacement:
636648
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
637649
Enabled: false
638650

651+
Performance/UnfreezeString:
652+
Description: 'Use unary plus to get an unfrozen string literal.'
653+
Enabled: false
654+
639655
# Rails
640656

641657
Rails/ActionFilter:

0 commit comments

Comments
 (0)