rubocop_default_config 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b889561ad61a1a8c5cfc487d41b066064730f06e
4
- data.tar.gz: 1786564a24ec6df6a63b49ff23023dcfbbd7a580
3
+ metadata.gz: 733a9fadd4d7c55e58f5e3d9b4bbc1c3e935079a
4
+ data.tar.gz: bcdac3b3465fccad5b80889da7586f385cb6f94d
5
5
  SHA512:
6
- metadata.gz: bf14b2e3a526e0e639325c87fb4fc17deffb63dff63198efad7cc6bfa5003bce60840a71a85cdfe04b228bf8added74c5bed7e6eae1b3e881c0b3f9f145f8089
7
- data.tar.gz: f7a53ae53b6637455a9dbbf6e147d5c5521376aa3680ca82552c8fca73d156a646ae01698c970e3bec6f49f58884f25b2a44e9a7813a73bad33ef2b4a53090e4
6
+ metadata.gz: 8918d41ed3c52ffaebbefd119d21ff4c468c6be1784e0e32eae4b7b151173412d86c62982dab6e057767ed5b0d5f9d8db063cc3f921cac9db6f0843bfae54da9
7
+ data.tar.gz: 128918629b91d6e2b0679271b107ce55fb6a44eb65eb210965d6850ae82fa70e22e5eb8bd67367d2bc9499248dc5438cb7aa956232e0e350c56903487a96e203
data/README.md CHANGED
@@ -6,8 +6,22 @@
6
6
 
7
7
  ## Usage
8
8
 
9
+ ** Generate RuboCop config **
10
+
9
11
  Run `rubocop-config`
10
12
 
13
+ ** Update .rubocop.yml to lasted release **
14
+
15
+ Run `rubocop_update`
16
+
17
+ ** Update .rubocop.yml to a specified release **
18
+
19
+ Ex: Run `rubocop_update "0.51.0"`
20
+
21
+ ** Update .rubocop.yml between 2 releases **
22
+
23
+ Ex: Run `rubocop_update "0.49.1" "0.51.0"`
24
+
11
25
  **Note**
12
26
 
13
27
  This gem will generates *.rubocop.yml* & *.rubocop_todo.yml* config automatically. So, you do not need to run `rubocop --auto-gen-config` .
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubocop_config'
5
+ RubocopConfig.new.update
@@ -0,0 +1,206 @@
1
+ inherit_from: .rubocop_todo.yml
2
+ AllCops:
3
+ UseCache: true
4
+ TargetRailsVersion: 4.2
5
+ Exclude:
6
+ - 'db/schema.rb'
7
+ - 'db/*_schema.rb'
8
+ - 'vendor/**/*'
9
+ - Gemfile.lock
10
+ Rails:
11
+ Enabled: true
12
+
13
+ # Metric Cop
14
+ Metrics/ClassLength:
15
+ Description: Avoid classes longer than 100 lines of code.
16
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/ClassLength
17
+ Max: 100
18
+ Enabled: false
19
+ Metrics/LineLength:
20
+ Description: Limit lines to 80 characters.
21
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
22
+ Enabled: false
23
+ Metrics/MethodLength:
24
+ Description: Avoid methods longer than 10 lines of code.
25
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
26
+ Max: 10
27
+ Enabled: false
28
+ Metrics/ParameterLists:
29
+ Description: Avoid parameter lists longer than three or four parameters.
30
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
31
+ Enabled: false
32
+ Metrics/BlockLength:
33
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/BlockLength
34
+ Exclude:
35
+ - Rakefile
36
+ - "**/*.rake"
37
+ - spec/**/*.rb
38
+ Enabled: false
39
+ Metrics/ModuleLength:
40
+ Description: Avoid modules longer than 100 lines of code.
41
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/ModuleLength
42
+ Max: 100
43
+ Enabled: false
44
+ Metrics/CyclomaticComplexity:
45
+ Description: A complexity metric that is strongly correlated to the number of test
46
+ cases needed to validate a method.
47
+ StyleGuide: https://rubocop.readthedocs.io/en/latest/cops_metrics/#metricscyclomaticcomplexity
48
+ Enabled: false
49
+ Metrics/PerceivedComplexity:
50
+ Description: A complexity metric geared towards measuring complexity for a human
51
+ reader.
52
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/PerceivedComplexity
53
+ Enabled: false
54
+ Metrics/AbcSize:
55
+ Description: A calculated magnitude based on number of assignments, branches, and conditions.
56
+ StyleGuide: https://github.com/bbatsov/rubocop/blob/master/manual/cops_metrics.md#metricsabcsize
57
+ Enabled: false
58
+ Metrics/BlockNesting:
59
+ Description: Avoid excessive block nesting.
60
+ StyleGuide: https://github.com/bbatsov/rubocop/blob/master/manual/cops_metrics.md#metricsblocknesting
61
+ Enabled: false
62
+
63
+ # Naming Cop
64
+ Naming/PredicateName:
65
+ Description: Check the names of predicate methods.
66
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
67
+ Enabled: false
68
+ Naming/AccessorMethodName:
69
+ Description: Check accessor methods are named properly.
70
+ StyleGuide: https://github.com/bbatsov/rubocop/blob/master/manual/cops_naming.md#namingaccessormethodname
71
+ Enabled: false
72
+
73
+ # Rails Cop
74
+ Rails/UnknownEnv:
75
+ Description: This cop checks that environments called with Rails.env predicates exist.
76
+ StyleGuide: https://github.com/bbatsov/rubocop/blob/master/manual/cops_rails.md#railsunknownenv
77
+ Enabled: false
78
+
79
+ # Layout Cop
80
+ Layout/IndentHash:
81
+ Description: Checks the indentation of the first key in a hash literal.
82
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/IndentHash
83
+ Enabled: false
84
+ Layout/ClosingParenthesisIndentation:
85
+ Description: Checks the indentation of hanging closing parentheses.
86
+ StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/ClosingParenthesisIndentation
87
+ Enabled: false
88
+ Layout/EmptyLinesAroundClassBody:
89
+ Description: Keeps track of empty lines around class bodies.
90
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundClassBody
91
+ Enabled: false
92
+ Layout/EmptyLinesAroundModuleBody:
93
+ Description: Keeps track of empty lines around module bodies.
94
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundModuleBody
95
+ Enabled: false
96
+ Layout/EmptyLinesAroundMethodBody:
97
+ Description: Keeps track of empty lines around method bodies.
98
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundMethodBody
99
+ Enabled: false
100
+ Layout/EndOfLine:
101
+ Description: Use Unix-style line endings.
102
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
103
+ Enabled: false
104
+ Layout/InitialIndentation:
105
+ Description: Checks the indentation of the first non-blank non-comment line in a
106
+ file.
107
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/InitialIndentation
108
+ Enabled: false
109
+ Layout/FirstParameterIndentation:
110
+ Description: Checks the indentation of the first parameter in a method call.
111
+ Enabled: false
112
+ Layout/IndentArray:
113
+ Description: Checks the indentation of the first element in an array literal.
114
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/IndentArray
115
+ Enabled: false
116
+ Layout/SpaceBeforeBlockBraces:
117
+ Description: Checks that the left block brace has or doesn't have space before it.
118
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceBeforeBlockBraces
119
+ Enabled: false
120
+ Layout/Tab:
121
+ Description: No hard tabs.
122
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
123
+ Enabled: false
124
+
125
+ # Style cop
126
+ Style/FrozenStringLiteralComment:
127
+ Description: This cop is designed to help upgrade to Ruby 3.0, enable frozen string literals.
128
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment
129
+ Enabled: false
130
+ Style/Alias:
131
+ Description: Use alias_method instead of alias.
132
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
133
+ Enabled: false
134
+ Style/AsciiComments:
135
+ Description: Use only ascii symbols in comments.
136
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
137
+ Enabled: false
138
+ Style/BracesAroundHashParameters:
139
+ Description: Enforce braces style around hash parameters.
140
+ StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/BracesAroundHashParameters
141
+ Enabled: false
142
+ Style/CharacterLiteral:
143
+ Description: Checks for uses of character literals.
144
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
145
+ Enabled: false
146
+ Style/ClassAndModuleChildren:
147
+ Description: Checks style of children classes and modules.
148
+ StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/ClassAndModuleChildren
149
+ Enabled: false
150
+ Style/CommandLiteral:
151
+ Description: Use `` or %x around command literals.
152
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
153
+ Enabled: false
154
+ Style/Documentation:
155
+ Description: Document classes and non-namespace modules.
156
+ StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/Documentation
157
+ Enabled: false
158
+ Style/EachWithObject:
159
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
160
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EachWithObject
161
+ Enabled: false
162
+ Style/EndBlock:
163
+ Description: Avoid the use of END blocks.
164
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
165
+ Enabled: false
166
+ Style/FormatString:
167
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
168
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
169
+ Enabled: false
170
+ Style/RegexpLiteral:
171
+ Description: Use / or %r around regular expressions.
172
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
173
+ Enabled: false
174
+ Style/RescueModifier:
175
+ Description: Avoid using rescue in its modifier form.
176
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
177
+ Enabled: false
178
+ Style/StringLiterals:
179
+ Description: Checks if uses of quotes match the configured preference.
180
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
181
+ EnforcedStyle: double_quotes
182
+ Enabled: false
183
+ Style/StructInheritance:
184
+ Description: Checks for inheritance from Struct.new.
185
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
186
+ Enabled: false
187
+ Style/TrailingCommaInArguments:
188
+ Description: Checks for trailing comma in parameter lists.
189
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma
190
+ Enabled: false
191
+ Style/TrailingCommaInLiteral:
192
+ Description: Checks for trailing comma in literals.
193
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
194
+ Enabled: false
195
+ Style/UnneededCapitalW:
196
+ Description: Checks for %W when interpolation is not needed.
197
+ StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/UnneededCapitalW
198
+ Enabled: false
199
+ Style/UnneededPercentQ:
200
+ Description: Checks for %q/%Q when single quotes or double quotes would do.
201
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
202
+ Enabled: false
203
+ Style/EmptyMethod:
204
+ Description: This cop checks for the formatting of empty method definitions.
205
+ StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EmptyMethod
206
+ Enabled: false
@@ -23,8 +23,24 @@ class RubocopConfig
23
23
  def generate_common_config
24
24
  puts "Generating rubocop common config ..."
25
25
  file_name = ".rubocop.yml"
26
- config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_popular_config.yml'
26
+ config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_config_for_evokat.yml'
27
27
  config = YAML.safe_load(ERB.new(File.read(config_file)).result)
28
28
  File.open(file_name, "w") { |f| f << config.to_yaml }
29
29
  end
30
+
31
+ def update
32
+ versions = ARGV
33
+ if versions.empty?
34
+ puts "Update .rubocop.yml to latest release ..."
35
+ system('mry .rubocop.yml')
36
+ elsif versions.count == 1
37
+ puts "Update .rubocop.yml to #{versions.first} release ..."
38
+ system("mry --target=#{versions.first} .rubocop.yml")
39
+ else
40
+ first_version = versions.first
41
+ last_version = versions.last
42
+ puts "Update .rubocop.yml between #{first_version} and #{last_version} release ..."
43
+ system("mry --from=#{first_version} --target=#{last_version} .rubocop.yml")
44
+ end
45
+ end
30
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_default_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Huynh
@@ -52,19 +52,35 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.49'
55
- description: A simple gem to generate default config for RuboCop
55
+ - !ruby/object:Gem::Dependency
56
+ name: mry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: A simple gem to generate default config for RuboCop(for Evokat project)
56
70
  email: qthai.huynh@gmail.com
57
71
  executables:
58
72
  - rubocop_config
59
73
  - rubocop_gen_common
74
+ - rubocop_update
60
75
  extensions: []
61
76
  extra_rdoc_files: []
62
77
  files:
63
78
  - README.md
64
79
  - bin/rubocop_config
65
80
  - bin/rubocop_gen_common
81
+ - bin/rubocop_update
82
+ - lib/.rubocop_config_for_evokat.yml
66
83
  - lib/.rubocop_default_config.yml
67
- - lib/.rubocop_popular_config.yml
68
84
  - lib/rubocop_config.rb
69
85
  homepage: http://rubygems.org/gems/rubocop_default_config
70
86
  licenses:
@@ -1,954 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
- AllCops:
3
- UseCache: true
4
- TargetRailsVersion: 4.2
5
- Exclude:
6
- - 'db/schema.rb'
7
- - 'vendor/**/*'
8
- - Gemfile.lock
9
- Rails:
10
- Enabled: true
11
- Style/FrozenStringLiteralComment:
12
- Description: This cop is designed to help upgrade to Ruby 3.0, enable frozen string literals.
13
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment
14
- Enabled: false
15
- Style/SafeNavigation:
16
- Description: Safe navigation may cause a statement to start returning `nil` in addition
17
- to whatever it used to return.
18
- ConvertCodeThatCanStartToReturnNil: false
19
- StyleGuide: http://www.rubydoc.info/gems/rubocop/0.51.0/RuboCop/Cop/Style/SafeNavigation
20
- Enabled: true
21
- Lint/AmbiguousOperator:
22
- Description: Checks for ambiguous operators in the first argument of a method invocation
23
- without parentheses.
24
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Lint/AmbiguousOperator
25
- Enabled: true
26
- Lint/AmbiguousBlockAssociation:
27
- Description: This cop checks for ambiguous block association with method when param passed without parentheses.
28
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/AmbiguousBlockAssociation
29
- Enabled: false
30
- Lint/AmbiguousRegexpLiteral:
31
- Description: Checks for ambiguous regexp literals in the first argument of a method
32
- invocation without parenthesis.
33
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/AmbiguousRegexpLiteral
34
- Enabled: true
35
- Lint/AssignmentInCondition:
36
- Description: Don't use assignment in conditions.
37
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
38
- Enabled: true
39
- Lint/BlockAlignment:
40
- Description: Align block ends correctly.
41
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/BlockAlignment
42
- Enabled: true
43
- Lint/CircularArgumentReference:
44
- Description: Don't refer to the keyword argument in the default value.
45
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/CircularArgumentReference
46
- Enabled: true
47
- Lint/ConditionPosition:
48
- Description: Checks for condition placed in a confusing position relative to the
49
- keyword.
50
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
51
- Enabled: true
52
- Lint/Debugger:
53
- Description: Check for debugger calls.
54
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/Debugger
55
- Enabled: true
56
- Lint/DefEndAlignment:
57
- Description: Align ends corresponding to defs correctly.
58
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/DefEndAlignment
59
- Enabled: true
60
- Lint/DeprecatedClassMethods:
61
- Description: Check for deprecated class method calls.
62
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/DeprecatedClassMethods
63
- Enabled: true
64
- Lint/DuplicateMethods:
65
- Description: Check for duplicate methods calls.
66
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/DuplicateMethods
67
- Enabled: true
68
- Lint/EachWithObjectArgument:
69
- Description: Check for immutable argument given to each_with_object.
70
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EachWithObjectArgument
71
- Enabled: true
72
- Lint/ElseLayout:
73
- Description: Check for odd code arrangement in an else block.
74
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/ElseLayout
75
- Enabled: true
76
- Lint/EmptyEnsure:
77
- Description: Checks for empty ensure block.
78
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EmptyEnsure
79
- Enabled: true
80
- Lint/EmptyInterpolation:
81
- Description: Checks for empty string interpolation.
82
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EmptyInterpolation
83
- Enabled: true
84
- Lint/EndAlignment:
85
- Description: Align ends correctly.
86
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EndAlignment
87
- Enabled: true
88
- Lint/EndInMethod:
89
- Description: END blocks should not be placed inside method definitions.
90
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EndInMethod
91
- Enabled: true
92
- Lint/EnsureReturn:
93
- Description: Do not use return in an ensure block.
94
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
95
- Enabled: true
96
- Lint/FormatParameterMismatch:
97
- Description: The number of parameters to format/sprint must match the fields.
98
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/FormatParameterMismatch
99
- Enabled: true
100
- Lint/HandleExceptions:
101
- Description: Don't suppress exception.
102
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
103
- Enabled: true
104
- Lint/LiteralInInterpolation:
105
- Description: Checks for literals used in interpolation.
106
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/LiteralInInterpolation
107
- Enabled: true
108
- Lint/Loop:
109
- Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
110
- for post-loop tests.
111
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
112
- Enabled: true
113
- Lint/NestedMethodDefinition:
114
- Description: Do not use nested method definitions.
115
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
116
- Enabled: true
117
- Lint/NonLocalExitFromIterator:
118
- Description: Do not use return in iterator to cause non-local exit.
119
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/NonLocalExitFromIterator
120
- Enabled: true
121
- Lint/ParenthesesAsGroupedExpression:
122
- Description: Checks for method calls with a space before the opening parenthesis.
123
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
124
- Enabled: true
125
- Lint/RequireParentheses:
126
- Description: Use parentheses in the method call to avoid confusion about precedence.
127
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/RequireParentheses
128
- Enabled: true
129
- Lint/RescueException:
130
- Description: Avoid rescuing the Exception class.
131
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
132
- Enabled: true
133
- Lint/ShadowingOuterLocalVariable:
134
- Description: Do not use the same name as outer local variable for block arguments
135
- or block local variables.
136
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/ShadowingOuterLocalVariable
137
- Enabled: true
138
- Lint/StringConversionInInterpolation:
139
- Description: Checks for Object#to_s usage in string interpolation.
140
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
141
- Enabled: true
142
- Lint/UnderscorePrefixedVariableName:
143
- Description: Do not use prefix `_` for a variable that is used.
144
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UnderscorePrefixedVariableName
145
- Enabled: true
146
- Lint/UnneededDisable:
147
- Description: 'Checks for rubocop:disable comments that can be removed. Note: this
148
- cop is not disabled when disabling all cops. It must be explicitly disabled.'
149
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UnneededDisable
150
- Enabled: true
151
- Lint/UnusedBlockArgument:
152
- Description: Checks for unused block arguments.
153
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
154
- Enabled: true
155
- Lint/UnusedMethodArgument:
156
- Description: Checks for unused method arguments.
157
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
158
- Enabled: true
159
- Lint/UnreachableCode:
160
- Description: Unreachable code.
161
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UnreachableCode
162
- Enabled: true
163
- Lint/UselessAccessModifier:
164
- Description: Checks for useless access modifiers.
165
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UselessAccessModifier
166
- Enabled: true
167
- Lint/UselessAssignment:
168
- Description: Checks for useless assignment to a local variable.
169
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
170
- Enabled: true
171
- Lint/UselessComparison:
172
- Description: Checks for comparison of something with itself.
173
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UselessComparison
174
- Enabled: true
175
- Lint/UselessElseWithoutRescue:
176
- Description: Checks for useless `else` in `begin..end` without `rescue`.
177
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UselessElseWithoutRescue
178
- Enabled: true
179
- Lint/UselessSetterCall:
180
- Description: Checks for useless setter call to a local variable.
181
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/UselessSetterCall
182
- Enabled: true
183
- Lint/Void:
184
- Description: Possible use of operator/literal/variable in void context.
185
- Enabled: true
186
- Metrics/AbcSize:
187
- Description: A calculated magnitude based on number of assignments, branches, and
188
- conditions.
189
- Reference: http://c2.com/cgi/wiki?AbcMetric
190
- Enabled: true
191
- Max: 15
192
- Metrics/BlockNesting:
193
- Description: Avoid excessive block nesting
194
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
195
- Enabled: true
196
- Max: 4
197
- Metrics/ClassLength:
198
- Description: Avoid classes longer than 100 lines of code.
199
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/ClassLength
200
- Enabled: true
201
- Max: 100
202
- Metrics/CyclomaticComplexity:
203
- Description: A complexity metric that is strongly correlated to the number of test
204
- cases needed to validate a method.
205
- StyleGuide: https://rubocop.readthedocs.io/en/latest/cops_metrics/#metricscyclomaticcomplexity
206
- Enabled: true
207
- Metrics/LineLength:
208
- Description: Limit lines to 80 characters.
209
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
210
- Enabled: true
211
- Metrics/MethodLength:
212
- Description: Avoid methods longer than 10 lines of code.
213
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
214
- Enabled: true
215
- Max: 10
216
- Metrics/ModuleLength:
217
- Description: Avoid modules longer than 100 lines of code.
218
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/ModuleLength
219
- Enabled: true
220
- Max: 100
221
- Metrics/ParameterLists:
222
- Description: Avoid parameter lists longer than three or four parameters.
223
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
224
- Enabled: false
225
- Metrics/PerceivedComplexity:
226
- Description: A complexity metric geared towards measuring complexity for a human
227
- reader.
228
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/PerceivedComplexity
229
- Enabled: true
230
- Metrics/BlockLength:
231
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/BlockLength
232
- Exclude:
233
- - Rakefile
234
- - "**/*.rake"
235
- - spec/**/*.rb
236
- Performance/Count:
237
- Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
238
- `reject...count`, `select...length`, and `reject...length`.
239
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Performance/Count
240
- Enabled: true
241
- Performance/Detect:
242
- Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
243
- and `find_all.last`.
244
- Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
245
- Enabled: true
246
- Performance/FlatMap:
247
- Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
248
- or `Enumberable#collect..Array#flatten(1)`
249
- Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
250
- Enabled: true
251
- EnabledForFlattenWithoutParams: false
252
- Performance/ReverseEach:
253
- Description: Use `reverse_each` instead of `reverse.each`.
254
- Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
255
- Enabled: true
256
- Performance/Sample:
257
- Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`.
258
- Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
259
- Enabled: true
260
- Performance/Size:
261
- Description: Use `size` instead of `count` for counting the number of elements in
262
- `Array` and `Hash`.
263
- Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
264
- Enabled: true
265
- Performance/StringReplacement:
266
- Description: Use `tr` instead of `gsub` when you are replacing the same number of
267
- characters. Use `delete` instead of `gsub` when you are deleting characters.
268
- Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
269
- Enabled: true
270
- Rails/ActionFilter:
271
- Description: Enforces consistent use of action filter methods.
272
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Rails/ActionFilter
273
- Enabled: false
274
- Rails/Date:
275
- Description: Checks the correct usage of date aware methods, such as Date.today,
276
- Date.current etc.
277
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Rails/Date
278
- Enabled: true
279
- Rails/Delegate:
280
- Description: Prefer delegate method for delegations.
281
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Rails/Delegate
282
- Enabled: true
283
- Rails/FindBy:
284
- Description: Prefer find_by over where.first.
285
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Rails/FindBy
286
- Enabled: true
287
- Rails/FindEach:
288
- Description: Prefer all.find_each over all.find.
289
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Rails/FindEach
290
- Enabled: true
291
- Rails/HasAndBelongsToMany:
292
- Description: Prefer has_many :through to has_and_belongs_to_many.
293
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Rails/HasAndBelongsToMany
294
- Enabled: true
295
- Rails/Output:
296
- Description: Checks for calls to puts, print, etc.
297
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Rails/Output
298
- Enabled: true
299
- Rails/ReadWriteAttribute:
300
- Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
301
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Rails/ReadWriteAttribute
302
- Enabled: false
303
- Rails/ScopeArgs:
304
- Description: Checks the arguments of ActiveRecord scopes.
305
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Rails/ScopeArgs
306
- Enabled: true
307
- Rails/TimeZone:
308
- Description: Checks the correct usage of time zone aware methods.
309
- StyleGuide: https://github.com/bbatsov/rails-style-guide#time
310
- Reference: http://danilenko.org/2012/7/6/rails_timezones
311
- Enabled: true
312
- Rails/Validation:
313
- Description: Use validates :attribute, hash of validations.
314
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Rails/Validation
315
- Enabled: true
316
- Layout/AccessModifierIndentation:
317
- Description: Check indentation of private/protected visibility modifiers.
318
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
319
- Enabled: false
320
- Style/Alias:
321
- Description: Use alias_method instead of alias.
322
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
323
- Enabled: false
324
- Layout/AlignArray:
325
- Description: Align the elements of an array literal if they span more than one line.
326
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
327
- Enabled: true
328
- Layout/AlignHash:
329
- Description: Align the elements of a hash literal if they span more than one line.
330
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/AlignHash
331
- Enabled: true
332
- Layout/AlignParameters:
333
- Description: Align the parameters of a method call if they span more than one line.
334
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
335
- Enabled: true
336
- Style/AndOr:
337
- Description: Use &&/|| instead of and/or.
338
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
339
- Enabled: true
340
- Style/ArrayJoin:
341
- Description: Use Array#join instead of Array#*.
342
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
343
- Enabled: false
344
- Style/AsciiComments:
345
- Description: Use only ascii symbols in comments.
346
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
347
- Enabled: false
348
- Naming/AsciiIdentifiers:
349
- Description: Use only ascii symbols in identifiers.
350
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
351
- Enabled: false
352
- Style/Attr:
353
- Description: Checks for uses of Module#attr.
354
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
355
- Enabled: true
356
- Style/BeginBlock:
357
- Description: Avoid the use of BEGIN blocks.
358
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
359
- Enabled: true
360
- Style/BarePercentLiterals:
361
- Description: Checks if usage of %() or %Q() matches configuration.
362
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
363
- Enabled: true
364
- Style/BlockComments:
365
- Description: Do not use block comments.
366
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
367
- Enabled: false
368
- Layout/BlockEndNewline:
369
- Description: Put end statement of multiline block on its own line.
370
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/BlockEndNewline
371
- Enabled: true
372
- Style/BlockDelimiters:
373
- Description: Avoid using {...} for multi-line blocks (multiline chaining is always
374
- ugly). Prefer {...} over do...end for single-line blocks.
375
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
376
- Enabled: true
377
- Style/BracesAroundHashParameters:
378
- Description: Enforce braces style around hash parameters.
379
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/BracesAroundHashParameters
380
- Enabled: false
381
- Style/CaseEquality:
382
- Description: Avoid explicit use of the case equality operator(===).
383
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
384
- Enabled: false
385
- Layout/CaseIndentation:
386
- Description: Indentation of when in a case/when/[else/]end.
387
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
388
- Enabled: true
389
- Style/CharacterLiteral:
390
- Description: Checks for uses of character literals.
391
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
392
- Enabled: false
393
- Naming/ClassAndModuleCamelCase:
394
- Description: Use CamelCase for classes and modules.
395
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
396
- Enabled: true
397
- Style/ClassAndModuleChildren:
398
- Description: Checks style of children classes and modules.
399
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/ClassAndModuleChildren
400
- Enabled: false
401
- Style/ClassCheck:
402
- Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
403
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/ClassCheck
404
- Enabled: true
405
- Style/ClassMethods:
406
- Description: Use self when defining module/class methods.
407
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods
408
- Enabled: false
409
- Style/ClassVars:
410
- Description: Avoid the use of class variables.
411
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
412
- Enabled: false
413
- Layout/ClosingParenthesisIndentation:
414
- Description: Checks the indentation of hanging closing parentheses.
415
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/ClosingParenthesisIndentation
416
- Enabled: false
417
- Style/ColonMethodCall:
418
- Description: 'Do not use :: for method call.'
419
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
420
- Enabled: true
421
- Style/CommandLiteral:
422
- Description: Use `` or %x around command literals.
423
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
424
- Enabled: false
425
- Style/CommentAnnotation:
426
- Description: Checks formatting of annotation comments.
427
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
428
- Enabled: false
429
- Layout/CommentIndentation:
430
- Description: Indentation of comments.
431
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/CommentIndentation
432
- Enabled: false
433
- Naming/ConstantName:
434
- Description: Constants should use SCREAMING_SNAKE_CASE.
435
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
436
- Enabled: true
437
- Style/DefWithParentheses:
438
- Description: Use def with parentheses when there are arguments.
439
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
440
- Enabled: true
441
- Style/Documentation:
442
- Description: Document classes and non-namespace modules.
443
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/Documentation
444
- Enabled: false
445
- Layout/DotPosition:
446
- Description: Checks the position of the dot in multi-line method calls.
447
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
448
- Enabled: true
449
- Style/DoubleNegation:
450
- Description: Checks for uses of double negation (!!).
451
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
452
- Enabled: true
453
- Style/EachWithObject:
454
- Description: Prefer `each_with_object` over `inject` or `reduce`.
455
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EachWithObject
456
- Enabled: false
457
- Layout/ElseAlignment:
458
- Description: Align elses and elsifs correctly.
459
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/ElseAlignment
460
- Enabled: true
461
- Style/EmptyElse:
462
- Description: Avoid empty else-clauses.
463
- Enabled: true
464
- Layout/EmptyLineBetweenDefs:
465
- Description: Use empty lines between defs.
466
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
467
- Enabled: true
468
- Layout/EmptyLines:
469
- Description: Don't use several empty lines in a row.
470
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLines
471
- Enabled: true
472
- Layout/EmptyLinesAroundAccessModifier:
473
- Description: Keep blank lines around access modifiers.
474
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundAccessModifier
475
- Enabled: false
476
- Layout/EmptyLinesAroundBlockBody:
477
- Description: Keeps track of empty lines around block bodies.
478
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundBlockBody
479
- Enabled: false
480
- Layout/EmptyLinesAroundClassBody:
481
- Description: Keeps track of empty lines around class bodies.
482
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundClassBody
483
- Enabled: false
484
- Layout/EmptyLinesAroundModuleBody:
485
- Description: Keeps track of empty lines around module bodies.
486
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundModuleBody
487
- Enabled: false
488
- Layout/EmptyLinesAroundMethodBody:
489
- Description: Keeps track of empty lines around method bodies.
490
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/EmptyLinesAroundMethodBody
491
- Enabled: false
492
- Style/EmptyLiteral:
493
- Description: Prefer literals to Array.new/Hash.new/String.new.
494
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
495
- Enabled: false
496
- Style/EndBlock:
497
- Description: Avoid the use of END blocks.
498
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
499
- Enabled: false
500
- Layout/EndOfLine:
501
- Description: Use Unix-style line endings.
502
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
503
- Enabled: false
504
- Style/EvenOdd:
505
- Description: Favor the use of Fixnum#even? && Fixnum#odd?
506
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
507
- Enabled: true
508
- Layout/ExtraSpacing:
509
- Description: Do not use unnecessary spacing.
510
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/ExtraSpacing
511
- Enabled: true
512
- Naming/FileName:
513
- Description: Use snake_case for source file names.
514
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
515
- Enabled: true
516
- Layout/InitialIndentation:
517
- Description: Checks the indentation of the first non-blank non-comment line in a
518
- file.
519
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/InitialIndentation
520
- Enabled: false
521
- Layout/FirstParameterIndentation:
522
- Description: Checks the indentation of the first parameter in a method call.
523
- Enabled: false
524
- Style/FlipFlop:
525
- Description: Checks for flip flops
526
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
527
- Enabled: true
528
- Style/For:
529
- Description: Checks use of for or each in multiline loops.
530
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
531
- Enabled: true
532
- Style/FormatString:
533
- Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
534
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
535
- Enabled: false
536
- Style/GlobalVars:
537
- Description: Do not introduce global variables.
538
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
539
- Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
540
- Enabled: true
541
- Style/GuardClause:
542
- Description: Check for conditionals that can be replaced with guard clauses
543
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
544
- Enabled: true
545
- Style/HashSyntax:
546
- Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
547
- 1, :b => 2 }.'
548
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
549
- Enabled: true
550
- Style/IfUnlessModifier:
551
- Description: Favor modifier if/unless usage when you have a single-line body.
552
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
553
- Enabled: true
554
- Style/IfWithSemicolon:
555
- Description: Do not use if x; .... Use the ternary operator instead.
556
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
557
- Enabled: true
558
- Layout/IndentationConsistency:
559
- Description: Keep indentation straight.
560
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/IndentationConsistency
561
- Enabled: false
562
- Layout/IndentationWidth:
563
- Description: Use 2 spaces for indentation.
564
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
565
- Enabled: true
566
- Layout/IndentArray:
567
- Description: Checks the indentation of the first element in an array literal.
568
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/IndentArray
569
- Enabled: false
570
- Layout/IndentHash:
571
- Description: Checks the indentation of the first key in a hash literal.
572
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/IndentHash
573
- Enabled: false
574
- Style/InfiniteLoop:
575
- Description: Use Kernel#loop for infinite loops.
576
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
577
- Enabled: true
578
- Style/Lambda:
579
- Description: Use the new lambda literal syntax for single-line blocks.
580
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
581
- Enabled: true
582
- Style/LambdaCall:
583
- Description: Use lambda.call(...) instead of lambda.(...).
584
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
585
- Enabled: false
586
- Layout/LeadingCommentSpace:
587
- Description: Comments should start with a space.
588
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
589
- Enabled: true
590
- Style/LineEndConcatenation:
591
- Description: Use \ instead of + or << to concatenate two string literals at line
592
- end.
593
- StyleGuide: http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/LineEndConcatenation
594
- Enabled: true
595
- Style/MethodCallWithoutArgsParentheses:
596
- Description: Do not use parentheses for method calls with no arguments.
597
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
598
- Enabled: true
599
- Style/MethodDefParentheses:
600
- Description: Checks if the method definitions have or don't have parentheses.
601
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
602
- Enabled: true
603
- Naming/MethodName:
604
- Description: Use the configured style when naming methods.
605
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
606
- Enabled: false
607
- Style/ModuleFunction:
608
- Description: Checks for usage of `extend self` in modules.
609
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
610
- Enabled: true
611
- Style/MultilineBlockChain:
612
- Description: Avoid multi-line chains of blocks.
613
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
614
- Enabled: false
615
- Layout/MultilineBlockLayout:
616
- Description: Ensures newlines after multiline block do statements.
617
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/MultilineBlockLayout
618
- Enabled: true
619
- Style/MultilineIfThen:
620
- Description: Do not use then for multi-line if/unless.
621
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
622
- Enabled: true
623
- Layout/MultilineOperationIndentation:
624
- Description: Checks indentation of binary operations that span more than one line.
625
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/MultilineOperationIndentation
626
- Enabled: false
627
- Style/MultilineTernaryOperator:
628
- Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
629
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
630
- Enabled: true
631
- Style/NegatedIf:
632
- Description: Favor unless over if for negative conditions (or control flow or).
633
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
634
- Enabled: true
635
- Style/NegatedWhile:
636
- Description: Favor until over while for negative conditions.
637
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
638
- Enabled: true
639
- Style/NestedTernaryOperator:
640
- Description: Use one expression per branch in a ternary operator.
641
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
642
- Enabled: true
643
- Style/Next:
644
- Description: Use `next` to skip iteration instead of a condition at the end.
645
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
646
- Enabled: true
647
- Style/NilComparison:
648
- Description: Prefer x.nil? to x == nil.
649
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
650
- Enabled: true
651
- Style/NonNilCheck:
652
- Description: Checks for redundant nil checks.
653
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
654
- Enabled: true
655
- Style/Not:
656
- Description: Use ! instead of not.
657
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
658
- Enabled: true
659
- Style/NumericLiterals:
660
- Description: Add underscores to large numeric literals to improve their readability.
661
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
662
- Enabled: true
663
- Style/OneLineConditional:
664
- Description: Favor the ternary operator(?:) over if/then/else/end constructs.
665
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
666
- Enabled: false
667
- Naming/BinaryOperatorParameterName:
668
- Description: When defining binary operators, name the argument other.
669
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
670
- Enabled: false
671
- Style/OptionalArguments:
672
- Description: Checks for optional arguments that do not appear at the end of the
673
- argument list
674
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#optional-arguments
675
- Enabled: false
676
- Style/ParallelAssignment:
677
- Description: Check for simple usages of parallel assignment. It will only warn when
678
- the number of variables matches on both sides of the assignment. This also provides
679
- performance benefits
680
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parallel-assignment
681
- Enabled: false
682
- Style/ParenthesesAroundCondition:
683
- Description: Don't use parentheses around the condition of an if/unless/while.
684
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
685
- Enabled: true
686
- Style/PercentLiteralDelimiters:
687
- Description: Use `%`-literal delimiters consistently
688
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
689
- Enabled: true
690
- PreferredDelimiters:
691
- default: ()
692
- '%i': '()'
693
- '%I': '()'
694
- '%r': '{}'
695
- '%w': '()'
696
- '%W': '()'
697
- Style/PercentQLiterals:
698
- Description: Checks if uses of %Q/%q match the configured preference.
699
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/PercentQLiterals
700
- Enabled: true
701
- Style/PerlBackrefs:
702
- Description: Avoid Perl-style regex back references.
703
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
704
- Enabled: false
705
- Naming/PredicateName:
706
- Description: Check the names of predicate methods.
707
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
708
- Enabled: true
709
- Style/Proc:
710
- Description: Use proc instead of Proc.new.
711
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
712
- Enabled: true
713
- Style/RaiseArgs:
714
- Description: Checks the arguments passed to raise/fail.
715
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
716
- Enabled: false
717
- Style/RedundantBegin:
718
- Description: Don't use begin blocks when they are not needed.
719
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
720
- Enabled: true
721
- Style/RedundantException:
722
- Description: Checks for an obsolete RuntimeException argument in raise/fail.
723
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
724
- Enabled: true
725
- Style/RedundantReturn:
726
- Description: Don't use return where it's not required.
727
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
728
- Enabled: true
729
- Style/RedundantSelf:
730
- Description: Don't use self where it's not needed.
731
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
732
- Enabled: true
733
- Style/RegexpLiteral:
734
- Description: Use / or %r around regular expressions.
735
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
736
- Enabled: false
737
- Layout/RescueEnsureAlignment:
738
- Description: Align rescues and ensures correctly.
739
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/RescueEnsureAlignment
740
- Enabled: false
741
- Style/RescueModifier:
742
- Description: Avoid using rescue in its modifier form.
743
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
744
- Enabled: false
745
- Style/SelfAssignment:
746
- Description: Checks for places where self-assignment shorthand should have been
747
- used.
748
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
749
- Enabled: true
750
- Style/Semicolon:
751
- Description: Don't use semicolons to terminate expressions.
752
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
753
- Enabled: true
754
- Style/SignalException:
755
- Description: Checks for proper usage of fail and raise.
756
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
757
- Enabled: true
758
- Style/SingleLineBlockParams:
759
- Description: Enforces the names of some block params.
760
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
761
- Enabled: true
762
- Style/SingleLineMethods:
763
- Description: Avoid single-line methods.
764
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
765
- Enabled: false
766
- Layout/SpaceBeforeFirstArg:
767
- Description: Checks that exactly one space is used between a method name and the
768
- first argument for method calls without parentheses.
769
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/SpaceBeforeFirstArg
770
- Enabled: true
771
- Layout/SpaceAfterColon:
772
- Description: Use spaces after colons.
773
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
774
- Enabled: true
775
- Layout/SpaceAfterComma:
776
- Description: Use spaces after commas.
777
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
778
- Enabled: true
779
- Layout/SpaceAroundKeyword:
780
- Description: Use spaces around keywords.
781
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/SpaceAroundKeyword
782
- Enabled: true
783
- Layout/SpaceAfterMethodName:
784
- Description: Do not put a space between a method name and the opening parenthesis
785
- in a method definition.
786
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
787
- Enabled: true
788
- Layout/SpaceAfterNot:
789
- Description: Tracks redundant space after the ! operator.
790
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
791
- Enabled: false
792
- Layout/SpaceAfterSemicolon:
793
- Description: Use spaces after semicolons.
794
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
795
- Enabled: true
796
- Layout/SpaceBeforeBlockBraces:
797
- Description: Checks that the left block brace has or doesn't have space before it.
798
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceBeforeBlockBraces
799
- Enabled: false
800
- Layout/SpaceBeforeComma:
801
- Description: No spaces before commas.
802
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceBeforeComma
803
- Enabled: false
804
- Layout/SpaceBeforeComment:
805
- Description: Checks for missing space between code and a comment on the same line.
806
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Layout/SpaceBeforeComment
807
- Enabled: false
808
- Layout/SpaceBeforeSemicolon:
809
- Description: No spaces before semicolons.
810
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceBeforeSemicolon
811
- Enabled: false
812
- Layout/SpaceInsideBlockBraces:
813
- Description: Checks that block braces have or don't have surrounding space. For
814
- blocks taking parameters, checks that the left brace has or doesn't have trailing
815
- space.
816
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceInsideBlockBraces
817
- Enabled: false
818
- Layout/SpaceAroundBlockParameters:
819
- Description: Checks the spacing inside and after block parameters pipes.
820
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/SpaceAroundBlockParameters
821
- Enabled: true
822
- Layout/SpaceAroundEqualsInParameterDefault:
823
- Description: Checks that the equals signs in parameter default assignments have
824
- or don't have surrounding space depending on configuration.
825
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
826
- Enabled: true
827
- Layout/SpaceAroundOperators:
828
- Description: Use a single space around operators.
829
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
830
- Enabled: true
831
- Layout/SpaceInsideBrackets:
832
- Description: No spaces after [ or before ].
833
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
834
- Enabled: false
835
- Layout/SpaceInsideHashLiteralBraces:
836
- Description: Use spaces inside hash literal braces - or don't.
837
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
838
- Enabled: true
839
- Layout/SpaceInsideParens:
840
- Description: No spaces after ( or before ).
841
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
842
- Enabled: true
843
- Layout/SpaceInsideRangeLiteral:
844
- Description: No spaces inside range literals.
845
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
846
- Enabled: true
847
- Layout/SpaceInsideStringInterpolation:
848
- Description: Checks for padding/surrounding spaces inside string interpolation.
849
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
850
- Enabled: false
851
- Style/SpecialGlobalVars:
852
- Description: Avoid Perl-style global variables.
853
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
854
- Enabled: false
855
- Style/StringLiterals:
856
- Description: Checks if uses of quotes match the configured preference.
857
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
858
- EnforcedStyle: double_quotes
859
- Enabled: false
860
- Style/StringLiteralsInInterpolation:
861
- Description: Checks if uses of quotes inside expressions in interpolated strings
862
- match the configured preference.
863
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/StringLiteralsInInterpolation
864
- Enabled: true
865
- Style/StructInheritance:
866
- Description: Checks for inheritance from Struct.new.
867
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
868
- Enabled: false
869
- Style/SymbolLiteral:
870
- Description: Use plain symbols instead of string symbols when possible.
871
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SymbolLiteral
872
- Enabled: false
873
- Style/SymbolProc:
874
- Description: Use symbols as procs instead of blocks when possible.
875
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SymbolProc
876
- Enabled: false
877
- Layout/Tab:
878
- Description: No hard tabs.
879
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
880
- Enabled: false
881
- Layout/TrailingBlankLines:
882
- Description: Checks trailing blank lines and final newline.
883
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
884
- Enabled: false
885
- Style/TrailingCommaInArguments:
886
- Description: Checks for trailing comma in parameter lists.
887
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma
888
- Enabled: false
889
- Style/TrailingCommaInLiteral:
890
- Description: Checks for trailing comma in literals.
891
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
892
- Enabled: false
893
- Layout/TrailingWhitespace:
894
- Description: Avoid trailing whitespace.
895
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
896
- Enabled: false
897
- Style/TrivialAccessors:
898
- Description: Prefer attr_* methods to trivial readers/writers.
899
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
900
- Enabled: false
901
- Style/UnlessElse:
902
- Description: Do not use unless with else. Rewrite these with the positive case first.
903
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
904
- Enabled: true
905
- Style/UnneededCapitalW:
906
- Description: Checks for %W when interpolation is not needed.
907
- StyleGuide: http://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/UnneededCapitalW
908
- Enabled: false
909
- Style/UnneededPercentQ:
910
- Description: Checks for %q/%Q when single quotes or double quotes would do.
911
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
912
- Enabled: false
913
- Style/TrailingUnderscoreVariable:
914
- Description: Checks for the usage of unneeded trailing underscores at the end of
915
- parallel variable assignment.
916
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/TrailingUnderscoreVariable
917
- Enabled: false
918
- Style/VariableInterpolation:
919
- Description: Don't interpolate global, instance and class variables directly in
920
- strings.
921
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
922
- Enabled: true
923
- Naming/VariableName:
924
- Description: Use the configured style when naming variables.
925
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
926
- Enabled: true
927
- Style/WhenThen:
928
- Description: Use when x then ... for one-line cases.
929
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
930
- Enabled: true
931
- Style/WhileUntilDo:
932
- Description: Checks for redundant do after while or until.
933
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
934
- Enabled: true
935
- Style/WhileUntilModifier:
936
- Description: Favor modifier while/until usage when you have a single-line body.
937
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
938
- Enabled: true
939
- Style/MutableConstant:
940
- Description: This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
941
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/MutableConstant
942
- Enabled: true
943
- Style/WordArray:
944
- Description: Use %w or %W for arrays of words.
945
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
946
- Enabled: true
947
- Style/EmptyMethod:
948
- Description: This cop checks for the formatting of empty method definitions.
949
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EmptyMethod
950
- Enabled: false
951
- Security/Eval:
952
- Description: The use of eval represents a serious security risk.
953
- StyleGuide: http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Security/Eval
954
- # Enabled: true