-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rubocop.yml
117 lines (90 loc) · 3.36 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
AllCops:
NewCops: enable
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- node_modules/**/* # JavaScript content (managed by yarn), if this dir doesn't exist it is quietly ignored.
- db/schema.rb # Auto-generated.
- Gemfile
Style/Documentation:
Exclude:
- db/migrate/* # Migration names should be sufficiently descriptive.
# The default is too small
Metrics/ClassLength:
Max: 400
# The default is too small
Metrics/BlockLength:
Max: 200
# The default is too small
Metrics/MethodLength:
Max: 100
Metrics/AbcSize:
Enabled: false
# default is too small
Metrics/ParameterLists:
Max: 6
# The default is too small
Metrics/CyclomaticComplexity:
Max: 10
# The default is too small
Metrics/PerceivedComplexity:
Max: 10
# The default is too small
Layout/LineLength:
Max: 200
Layout/EmptyLinesAroundBlockBody:
Exclude:
- lib/tasks/*
- spec/**/*
# There's nothing special about the first line in a class - force a line break to separate it from the class def (every other method etc is separated with a linebreak)
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines
# There's nothing special about the first line in a module - force a line break to separate it from the module def (every other method etc is separated with a linebreak)
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines
# The default is too small
Layout/LineLength:
Max: 200
# No space makes the method definition shorter and differentiates
# from a regular assignment.
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
# prefer spaces around expressions inside string interpolation
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: space
# Indent to make it more obvious that it's a continuation of preceeding line(s)
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# More interested in the method (than the dot) - indent to show the continutation of a chain over a line break
Layout/DotPosition:
EnforcedStyle: trailing
# Sometimes key, sometimes table - table is (slightly) more common (probably)
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
Style/EmptyMethod:
Enabled: false
# Ruby 3.0+ optional feature, except rubocop expects that it has been opted-in, rubocop wants this at the top of every file:
# frozen_string_literal: true
Style/FrozenStringLiteralComment:
Enabled: false
# prefer consistant use of double quotes for strings
Style/StringLiterals:
EnforcedStyle: double_quotes
# double quotes in strings inside interpolated expressions also
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Sometimes "unless xyz", sometimes "if !xyz" - context typically determines which is easier to grok
Style/NegatedIf:
Enabled: false
# Remove some magic and be more explicit - prefer verbosity and clarity (if the author deems it worthwhile, however there's no way to enforce this)
Style/RedundantReturn:
Enabled: false
# Remove some magic and be more explicit (and Java-like) - prefer verbosity and clarity (if the author deems it worthwhile, however there's no way to enforce this)
Style/RedundantSelf:
Enabled: false
# The default of require_no_parentheses makes ternary's much harder to read (and more error-prone when operator precedence comes into play)
Style/TernaryParentheses:
EnforcedStyle: require_parentheses
Style/OpenStructUse:
Enabled: false