forked from simplecov-ruby/simplecov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
142 lines (116 loc) · 4.07 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
AllCops:
Exclude:
- "spec/fixtures/iso-8859.rb"
- "spec/fixtures/utf-8.rb"
- "spec/fixtures/utf-8-magic.rb"
- "spec/fixtures/euc-jp.rb"
- "spec/fixtures/empty_euc-jp.rb"
- "spec/fixtures/euc-jp-shebang.rb"
- "test_projects/**/*"
- "tmp/**/*"
- "vendor/bundle/**/*"
- "vendor/bundle/**/.*"
TargetRubyVersion: 2.4
Bundler/OrderedGems:
Description: Gems should be alphabetically sorted within groups.
Enabled: false
# Open for revision would like table style but the impact
# would probably be huge
Layout/HashAlignment:
Enabled: false
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Exclude:
- "features/**/*_steps.rb"
- "spec/**/*_steps.rb"
- "tmp/**/*_steps.rb"
Metrics/AbcSize:
Description: Checks that the ABC size of methods is not higher than the configured maximum.
Max: 25 # TODO: Lower to 15
Metrics/BlockLength:
Description: Checks if the length of a block exceeds some maximum value.
Exclude:
- "spec/**/*.rb"
Metrics/BlockNesting:
Description: Avoid excessive block nesting.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#three-is-the-number-thou-shalt-count
Max: 2
Metrics/ClassLength:
Max: 300
Layout/LineLength:
Description: Checks the length of lines in the source code.
AllowURI: true
Enabled: false
Metrics/MethodLength:
Description: Checks if the length of a method exceeds some maximum value.
CountComments: false
Max: 12 # TODO: Lower to 10
Metrics/ModuleLength:
Description: Avoid modules longer than 100 lines of code.
Exclude:
- "lib/simplecov.rb"
Metrics/ParameterLists:
Description: Avoid parameter lists longer than three or four parameters.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#too-many-params
Max: 4
CountKeywordArgs: true
Layout/AccessModifierIndentation:
Description: Modifiers should be indented as deep as method definitions,
or as deep as the class/module keyword, depending on configuration.
EnforcedStyle: outdent
Style/CollectionMethods:
Description: Enforces the use of consistent method names from the Enumerable module.
PreferredMethods:
map: "collect"
reduce: "inject"
find: "detect"
find_all: "select"
Style/Documentation:
Description: Checks for missing top-level documentation of classes and modules.
Enabled: false
Style/DoubleNegation:
Description: Checks for uses of double negation (!!).
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang
Enabled: false
Style/HashSyntax:
Description: Checks hash literal syntax.
EnforcedStyle: ruby19
Layout/HeredocIndentation:
Description: Checks the indentation of the here document bodies.
Enabled: false
Style/RegexpLiteral:
Description: Use / or %r around regular expressions.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#percent-r
Enabled: false
Layout/SpaceInsideHashLiteralBraces:
Description: Use spaces inside hash literal braces - or don't.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#spaces-operators
EnforcedStyle: no_space
Style/SpecialGlobalVars:
Description: Looks for uses of Perl-style global variables.
Exclude:
- "spec/deleted_source_spec.rb"
- "spec/return_codes_spec.rb"
- "lib/simplecov/defaults.rb"
Style/StringLiterals:
Description: Allow double-quoted strings without interpolation.
EnforcedStyle: double_quotes
Naming/FileName:
Description: makes sure that Ruby source files have snake_case names.
Exclude:
- "spec/fixtures/utf-8.rb"
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: no_comma
Style/GuardClause:
Description: Use a guard clause instead of wrapping the code inside a conditional expression.
Enabled: false
Style/FrozenStringLiteralComment:
Description:
Add the frozen_string_literal comment to the top of files to help transition
from Ruby 2.3.0 to Ruby 3.0.
Enabled: true
EnforcedStyle: always
Exclude:
- "spec/fixtures/**/*"