-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
121 lines (99 loc) · 3.73 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
118
119
120
121
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'bin/**/*'
- 'db/schema.rb'
- 'node_modules/**/*'
- 'vendor/**/*'
Layout/ArgumentAlignment:
Description: "Checks if the arguments on a multi-line method definition are aligned."
StyleGuide: 'https://rubystyle.guide/#no-double-indent'
EnforcedStyle: with_fixed_indentation
Enabled: true
Layout/LineLength:
Description: 'Limit lines to a certain number of characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Max: 120
Enabled: true
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Enabled: true
Layout/MultilineOperationIndentation:
Description: Checks indentation of binary operations that span more than one line.
EnforcedStyle: indented
Enabled: true
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Enabled: true
Metrics/BlockLength:
Description: 'This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.'
Exclude: ['spec/**/*', 'config/**/*', 'lib/tasks/**/*']
Enabled: true
Metrics/MethodLength:
CountComments: false
Max: 20
Exclude: ['db/migrate/**/*']
Naming/FileName:
Description: This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Exclude: ['lib/tasks/**/*']
Enabled: true
RSpec/ExampleLength:
Description: Checks for long examples. A long example is usually more difficult to understand. Consider extracting out some behaviour, e.g. with a let block, or a helper method.
Max: 10
Enabled: true
Exclude: ['spec/system/**/*']
RSpec/MultipleExpectations:
Description: Checks if examples contain too many expect calls.
Max: 5
Enabled: true
Exclude: ['spec/system/**/*']
RSpec/NestedGroups:
Description: Checks for nested example groups.
Max: 5
Enabled: true
RSpec/NotToNot:
Description: Checks for consistent method usage for negating expectations.
EnforcedStyle: to_not
Enabled: true
Style/ClassAndModuleChildren:
Description: Checks the style of children definitions at classes and modules.
EnforcedStyle: compact
# I think there are many cases where this type of documentation is useful, but I
# don't want to enforce it in every case. Just add docs where it helps.
Style/Documentation:
Enabled: false
# These comments clutter every file, and I'm already on Ruby 3.0+.
Style/FrozenStringLiteralComment:
Enabled: false
Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
EnforcedStyle: double_quotes
Enabled: true
Style/SymbolArray:
Description: 'Use `%i` or `%I` for an array of symbols'
StyleGuide: 'http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SymbolArray'
EnforcedStyle: brackets
Enabled: true
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
Enabled: true
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
EnforcedStyleForMultiline: comma
Enabled: true
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
EnforcedStyleForMultiline: comma
Enabled: true
Style/WordArray:
Description: 'Use %w or %W for arrays of words.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
EnforcedStyle: brackets
Enabled: true