locasms 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,67 +1,79 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe LocaSMS::RestClient do
5
+ describe LocaSMS::RestClient do # rubocop:disable RSpec/FilePath
6
+ subject(:rest_client) { described_class.new(action, params) }
7
+
8
+ let(:action) { :url }
4
9
  let(:callback) { 'http://example.com/callback' }
5
10
  let(:params) { { lgn: 'LOGIN', pwd: 'PASSWORD', url_callback: callback } }
6
11
 
7
12
  describe '.initialize' do
8
- context 'When giving proper initialization parameters' do
9
- subject { LocaSMS::RestClient.new :url, :params }
10
- it { expect(subject.base_url).to be(:url) }
11
- it { expect(subject.base_params).to be(:params) }
13
+ context 'when giving proper initialization parameters' do
14
+ let(:action) { :url }
15
+ let(:params) { :params }
16
+
17
+ it { expect(rest_client.base_url).to be(:url) }
18
+ it { expect(rest_client.base_params).to be(:params) }
12
19
  end
13
20
  end
14
21
 
15
22
  describe '#get' do
16
23
  let(:action) { 'sendsms' }
17
24
  let(:body) { '{"status":1,"data":28,"msg":null}' }
18
- subject { LocaSMS::RestClient.new(action, params) }
19
25
 
20
- it 'Performs get request to url with parameters' do
21
- expect(Net::HTTP).
22
- to receive(:get_response).
23
- and_return(OpenStruct.new(body: body))
26
+ it 'performs get request to url with parameters' do
27
+ allow(Net::HTTP)
28
+ .to receive(:get_response)
29
+ .and_return(OpenStruct.new(body: body))
24
30
 
25
- subject.get(action, params)
31
+ rest_client.get(action, params)
32
+
33
+ expect(Net::HTTP).to have_received(:get_response)
26
34
  end
27
35
  end
28
36
 
29
37
  describe '#params_for' do
30
- subject { LocaSMS::RestClient.new :url, params }
31
-
32
- it { expect(subject.params_for(:action)).to eq({action: :action}.merge(params)) }
33
- it { expect(subject.params_for(:action, p1: 10)).to eq({action: :action, p1: 10}.merge(params)) }
38
+ it { expect(rest_client.params_for(:action)).to eq({ action: :action }.merge(params)) }
39
+ it { expect(rest_client.params_for(:action, p1: 10)).to eq({ action: :action, p1: 10 }.merge(params)) }
34
40
 
35
- context 'callback nil' do
41
+ context 'when callback is nil' do
36
42
  let(:callback) { nil }
37
- it 'should not be in params' do
38
- expect(subject.params_for(:action)).to eq({action: :action, lgn: 'LOGIN', pwd: 'PASSWORD'})
43
+
44
+ it 'is not in params' do
45
+ expect(rest_client.params_for(:action)).to eq({ action: :action, lgn: 'LOGIN', pwd: 'PASSWORD' })
39
46
  end
40
47
  end
41
48
  end
42
49
 
43
50
  describe '#parse_response' do
44
- subject { LocaSMS::RestClient.new :url, :params }
45
-
46
- it 'Should raise exception on invalid operation' do
47
- expect { subject.parse_response(:action, '0:OPERACAO INVALIDA') }.to raise_error(LocaSMS::InvalidOperation)
51
+ it 'raises exception on invalid operation' do
52
+ expect { rest_client.parse_response(:action, '0:OPERACAO INVALIDA') }.to raise_error(LocaSMS::InvalidOperation)
48
53
  end
49
54
 
50
- it 'Should raise exception on a failed response' do
51
- expect { subject.parse_response(:action, '{"status":0,"data":null,"msg":"FALHA EPICA"}') }.to raise_error(LocaSMS::Exception, 'FALHA EPICA')
55
+ it 'raises exception on a failed response' do
56
+ response = '{"status":0,"data":null,"msg":"FALHA EPICA"}'
57
+
58
+ expect { rest_client.parse_response(:action, response) }.to raise_error(LocaSMS::Exception, 'FALHA EPICA')
52
59
  end
53
60
 
54
- it 'Should raise exception on a failed login attempt' do
55
- expect { subject.parse_response(:action, '{"status":0,"data":null,"msg":"FALHA AO REALIZAR LOGIN"}') }.to raise_error(LocaSMS::InvalidLogin)
61
+ it 'raises exception on a failed login attempt' do
62
+ response = '{"status":0,"data":null,"msg":"FALHA AO REALIZAR LOGIN"}'
63
+
64
+ expect { rest_client.parse_response(:action, response) }.to raise_error(LocaSMS::InvalidLogin)
56
65
  end
57
66
 
58
- it 'Should return the non-json value as a json' do
59
- expect(subject.parse_response(:action, 'non-json return')).to eq({'status' => 1, 'data' => 'non-json return', "msg" => nil})
67
+ it 'returns the non-json value as a json' do
68
+ response = { 'status' => 1, 'data' => 'non-json return', 'msg' => nil }
69
+
70
+ expect(rest_client.parse_response(:action, 'non-json return')).to eq(response)
60
71
  end
61
72
 
62
- it 'Should return a parsed json return' do
63
- expect(subject.parse_response(:action, '{"status":1,"data":28,"msg":null}')).to eq({'status' => 1, 'data' => 28, "msg" => nil})
73
+ it 'returns a parsed json return' do
74
+ response = { 'status' => 1, 'data' => 28, 'msg' => nil }
75
+
76
+ expect(rest_client.parse_response(:action, '{"status":1,"data":28,"msg":null}')).to eq(response)
64
77
  end
65
78
  end
66
-
67
79
  end
@@ -1,12 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
 
3
5
  $LOAD_PATH.unshift(File.dirname(__FILE__))
4
6
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
7
 
6
- # require 'coveralls'
7
- # require 'simplecov'
8
+ require 'simplecov'
8
9
 
9
- # SimpleCov.start
10
+ SimpleCov.start
10
11
 
11
12
  require 'locasms'
12
13
  require 'rspec'
@@ -16,4 +17,4 @@ Timecop.safe_mode = true
16
17
 
17
18
  RSpec.configure do |config|
18
19
  # see spec.opts
19
- end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locasms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adilson Carvalho
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-10-10 00:00:00.000000000 Z
13
+ date: 2020-10-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.0'
21
+ version: '1.13'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.0'
28
+ version: '1.13'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: bundler
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: '1.15'
35
+ version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - "~>"
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: '1.15'
42
+ version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '12.1'
49
+ version: '13.0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '12.1'
56
+ version: '13.0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rspec
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '3.6'
63
+ version: '3.9'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '3.6'
70
+ version: '3.9'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: timecop
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -82,6 +82,20 @@ dependencies:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0.9'
85
+ - !ruby/object:Gem::Dependency
86
+ name: redcarpet
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '3.5'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: '3.5'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: yard
87
101
  requirement: !ruby/object:Gem::Requirement
@@ -97,33 +111,47 @@ dependencies:
97
111
  - !ruby/object:Gem::Version
98
112
  version: '0.9'
99
113
  - !ruby/object:Gem::Dependency
100
- name: redcarpet
114
+ name: simplecov
101
115
  requirement: !ruby/object:Gem::Requirement
102
116
  requirements:
103
117
  - - "~>"
104
118
  - !ruby/object:Gem::Version
105
- version: '3.4'
119
+ version: '0.18'
106
120
  type: :development
107
121
  prerelease: false
108
122
  version_requirements: !ruby/object:Gem::Requirement
109
123
  requirements:
110
124
  - - "~>"
111
125
  - !ruby/object:Gem::Version
112
- version: '3.4'
126
+ version: '0.18'
113
127
  - !ruby/object:Gem::Dependency
114
- name: simplecov
128
+ name: rubocop
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: '0.93'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - "~>"
139
+ - !ruby/object:Gem::Version
140
+ version: '0.93'
141
+ - !ruby/object:Gem::Dependency
142
+ name: rubocop-rspec
115
143
  requirement: !ruby/object:Gem::Requirement
116
144
  requirements:
117
145
  - - "~>"
118
146
  - !ruby/object:Gem::Version
119
- version: '0.15'
147
+ version: '1.43'
120
148
  type: :development
121
149
  prerelease: false
122
150
  version_requirements: !ruby/object:Gem::Requirement
123
151
  requirements:
124
152
  - - "~>"
125
153
  - !ruby/object:Gem::Version
126
- version: '0.15'
154
+ version: '1.43'
127
155
  description: |-
128
156
  Cliente para o serviço de disparo de SMS da LocaSMS e de sua
129
157
  versão para Short Code SMS (SMS Plataforma)
@@ -137,7 +165,8 @@ extensions: []
137
165
  extra_rdoc_files: []
138
166
  files:
139
167
  - ".gitignore"
140
- - ".ruby-style.yml"
168
+ - ".rubocop.yml"
169
+ - ".rubocop_todo.yml"
141
170
  - ".travis.yml"
142
171
  - ".yardopts"
143
172
  - Gemfile
@@ -172,15 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
201
  requirements:
173
202
  - - "~>"
174
203
  - !ruby/object:Gem::Version
175
- version: '2.0'
204
+ version: '2.4'
176
205
  required_rubygems_version: !ruby/object:Gem::Requirement
177
206
  requirements:
178
207
  - - ">="
179
208
  - !ruby/object:Gem::Version
180
209
  version: '0'
181
210
  requirements: []
182
- rubyforge_project:
183
- rubygems_version: 2.5.2.3
211
+ rubygems_version: 3.0.3
184
212
  signing_key:
185
213
  specification_version: 4
186
214
  summary: Cliente para disparo de SMS, regular e Short Code, através da LocaSMS/SMS
@@ -1,1063 +0,0 @@
1
- AllCops:
2
- Include:
3
- - "**/*.gemspec"
4
- - "**/*.podspec"
5
- - "**/*.jbuilder"
6
- - "**/*.rake"
7
- - "**/*.opal"
8
- - "**/Gemfile"
9
- - "**/Rakefile"
10
- - "**/Capfile"
11
- - "**/Guardfile"
12
- - "**/Podfile"
13
- - "**/Thorfile"
14
- - "**/Vagrantfile"
15
- - "**/Berksfile"
16
- - "**/Cheffile"
17
- - "**/Vagabondfile"
18
- Exclude:
19
- - "vendor/**/*"
20
- - "db/schema.rb"
21
- RunRailsCops: false
22
- DisplayCopNames: false
23
- StyleGuideCopsOnly: false
24
- Style/AccessModifierIndentation:
25
- Description: Check indentation of private/protected visibility modifiers.
26
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
27
- Enabled: true
28
- EnforcedStyle: indent
29
- SupportedStyles:
30
- - outdent
31
- - indent
32
- Style/AlignHash:
33
- Description: Align the elements of a hash literal if they span more than one line.
34
- Enabled: true
35
- EnforcedHashRocketStyle: key
36
- EnforcedColonStyle: key
37
- EnforcedLastArgumentHashStyle: always_inspect
38
- SupportedLastArgumentHashStyles:
39
- - always_inspect
40
- - always_ignore
41
- - ignore_implicit
42
- - ignore_explicit
43
- Style/AlignParameters:
44
- Description: Align the parameters of a method call if they span more than one line.
45
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
46
- Enabled: true
47
- EnforcedStyle: with_first_parameter
48
- SupportedStyles:
49
- - with_first_parameter
50
- - with_fixed_indentation
51
- Style/AndOr:
52
- Description: Use &&/|| instead of and/or.
53
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
54
- Enabled: true
55
- EnforcedStyle: always
56
- SupportedStyles:
57
- - always
58
- - conditionals
59
- Style/BarePercentLiterals:
60
- Description: Checks if usage of %() or %Q() matches configuration.
61
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
62
- Enabled: true
63
- EnforcedStyle: bare_percent
64
- SupportedStyles:
65
- - percent_q
66
- - bare_percent
67
- Style/BracesAroundHashParameters:
68
- Description: Enforce braces style around hash parameters.
69
- Enabled: true
70
- EnforcedStyle: no_braces
71
- SupportedStyles:
72
- - braces
73
- - no_braces
74
- - context_dependent
75
- Style/CaseIndentation:
76
- Description: Indentation of when in a case/when/[else/]end.
77
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
78
- Enabled: true
79
- IndentWhenRelativeTo: case
80
- SupportedStyles:
81
- - case
82
- - end
83
- IndentOneStep: false
84
- Style/ClassAndModuleChildren:
85
- Description: Checks style of children classes and modules.
86
- Enabled: false
87
- EnforcedStyle: nested
88
- SupportedStyles:
89
- - nested
90
- - compact
91
- Style/ClassCheck:
92
- Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
93
- Enabled: true
94
- EnforcedStyle: is_a?
95
- SupportedStyles:
96
- - is_a?
97
- - kind_of?
98
- Style/CollectionMethods:
99
- Description: Preferred collection methods.
100
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
101
- Enabled: true
102
- PreferredMethods:
103
- collect: map
104
- collect!: map!
105
- find: detect
106
- find_all: select
107
- reduce: inject
108
- Style/CommentAnnotation:
109
- Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
110
- REVIEW).
111
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
112
- Enabled: false
113
- Keywords:
114
- - TODO
115
- - FIXME
116
- - OPTIMIZE
117
- - HACK
118
- - REVIEW
119
- Style/DotPosition:
120
- Description: Checks the position of the dot in multi-line method calls.
121
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
122
- Enabled: true
123
- EnforcedStyle: trailing
124
- SupportedStyles:
125
- - leading
126
- - trailing
127
- Style/EmptyLineBetweenDefs:
128
- Description: Use empty lines between defs.
129
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
130
- Enabled: true
131
- AllowAdjacentOneLineDefs: false
132
- Style/EmptyLinesAroundBlockBody:
133
- Description: Keeps track of empty lines around block bodies.
134
- Enabled: true
135
- EnforcedStyle: no_empty_lines
136
- SupportedStyles:
137
- - empty_lines
138
- - no_empty_lines
139
- Style/EmptyLinesAroundClassBody:
140
- Description: Keeps track of empty lines around class bodies.
141
- Enabled: true
142
- EnforcedStyle: no_empty_lines
143
- SupportedStyles:
144
- - empty_lines
145
- - no_empty_lines
146
- Style/EmptyLinesAroundModuleBody:
147
- Description: Keeps track of empty lines around module bodies.
148
- Enabled: true
149
- EnforcedStyle: no_empty_lines
150
- SupportedStyles:
151
- - empty_lines
152
- - no_empty_lines
153
- Style/Encoding:
154
- Description: Use UTF-8 as the source file encoding.
155
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
156
- Enabled: false
157
- EnforcedStyle: always
158
- SupportedStyles:
159
- - when_needed
160
- - always
161
- Style/FileName:
162
- Description: Use snake_case for source file names.
163
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
164
- Enabled: false
165
- Exclude: []
166
- Style/FirstParameterIndentation:
167
- Description: Checks the indentation of the first parameter in a method call.
168
- Enabled: true
169
- EnforcedStyle: special_for_inner_method_call_in_parentheses
170
- SupportedStyles:
171
- - consistent
172
- - special_for_inner_method_call
173
- - special_for_inner_method_call_in_parentheses
174
- Style/For:
175
- Description: Checks use of for or each in multiline loops.
176
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
177
- Enabled: true
178
- EnforcedStyle: each
179
- SupportedStyles:
180
- - for
181
- - each
182
- Style/FormatString:
183
- Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
184
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
185
- Enabled: false
186
- EnforcedStyle: format
187
- SupportedStyles:
188
- - format
189
- - sprintf
190
- - percent
191
- Style/GlobalVars:
192
- Description: Do not introduce global variables.
193
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
194
- Enabled: false
195
- AllowedVariables: []
196
- Style/GuardClause:
197
- Description: Check for conditionals that can be replaced with guard clauses
198
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
199
- Enabled: false
200
- MinBodyLength: 1
201
- Style/HashSyntax:
202
- Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
203
- 1, :b => 2 }.'
204
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
205
- Enabled: true
206
- EnforcedStyle: ruby19
207
- SupportedStyles:
208
- - ruby19
209
- - hash_rockets
210
- Style/IfUnlessModifier:
211
- Description: Favor modifier if/unless usage when you have a single-line body.
212
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
213
- Enabled: false
214
- MaxLineLength: 80
215
- Style/IndentationWidth:
216
- Description: Use 2 spaces for indentation.
217
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
218
- Enabled: true
219
- Width: 2
220
- Style/IndentHash:
221
- Description: Checks the indentation of the first key in a hash literal.
222
- Enabled: true
223
- EnforcedStyle: special_inside_parentheses
224
- SupportedStyles:
225
- - special_inside_parentheses
226
- - consistent
227
- Style/LambdaCall:
228
- Description: Use lambda.call(...) instead of lambda.(...).
229
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
230
- Enabled: false
231
- EnforcedStyle: call
232
- SupportedStyles:
233
- - call
234
- - braces
235
- Style/Next:
236
- Description: Use `next` to skip iteration instead of a condition at the end.
237
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
238
- Enabled: false
239
- EnforcedStyle: skip_modifier_ifs
240
- MinBodyLength: 3
241
- SupportedStyles:
242
- - skip_modifier_ifs
243
- - always
244
- Style/NonNilCheck:
245
- Description: Checks for redundant nil checks.
246
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
247
- Enabled: true
248
- IncludeSemanticChanges: false
249
- Style/MethodDefParentheses:
250
- Description: Checks if the method definitions have or don't have parentheses.
251
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
252
- Enabled: true
253
- EnforcedStyle: require_parentheses
254
- SupportedStyles:
255
- - require_parentheses
256
- - require_no_parentheses
257
- Style/MethodName:
258
- Description: Use the configured style when naming methods.
259
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
260
- Enabled: true
261
- EnforcedStyle: snake_case
262
- SupportedStyles:
263
- - snake_case
264
- - camelCase
265
- Style/MultilineOperationIndentation:
266
- Description: Checks indentation of binary operations that span more than one line.
267
- Enabled: true
268
- EnforcedStyle: aligned
269
- SupportedStyles:
270
- - aligned
271
- - indented
272
- Style/NumericLiterals:
273
- Description: Add underscores to large numeric literals to improve their readability.
274
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
275
- Enabled: false
276
- MinDigits: 5
277
- Style/ParenthesesAroundCondition:
278
- Description: Don't use parentheses around the condition of an if/unless/while.
279
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
280
- Enabled: true
281
- AllowSafeAssignment: true
282
- Style/PercentLiteralDelimiters:
283
- Description: Use `%`-literal delimiters consistently
284
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
285
- Enabled: false
286
- PreferredDelimiters:
287
- "%": "()"
288
- "%i": "()"
289
- "%q": "()"
290
- "%Q": "()"
291
- "%r": "{}"
292
- "%s": "()"
293
- "%w": "()"
294
- "%W": "()"
295
- "%x": "()"
296
- Style/PercentQLiterals:
297
- Description: Checks if uses of %Q/%q match the configured preference.
298
- Enabled: true
299
- EnforcedStyle: lower_case_q
300
- SupportedStyles:
301
- - lower_case_q
302
- - upper_case_q
303
- Style/PredicateName:
304
- Description: Check the names of predicate methods.
305
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
306
- Enabled: true
307
- NamePrefix:
308
- - is_
309
- - has_
310
- - have_
311
- NamePrefixBlacklist:
312
- - is_
313
- Style/RaiseArgs:
314
- Description: Checks the arguments passed to raise/fail.
315
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
316
- Enabled: false
317
- EnforcedStyle: exploded
318
- SupportedStyles:
319
- - compact
320
- - exploded
321
- Style/RedundantReturn:
322
- Description: Don't use return where it's not required.
323
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
324
- Enabled: true
325
- AllowMultipleReturnValues: false
326
- Style/RegexpLiteral:
327
- Description: Use %r for regular expressions matching more than `MaxSlashes` '/'
328
- characters. Use %r only for regular expressions matching more than `MaxSlashes`
329
- '/' character.
330
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
331
- Enabled: false
332
- MaxSlashes: 1
333
- Style/Semicolon:
334
- Description: Don't use semicolons to terminate expressions.
335
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
336
- Enabled: true
337
- AllowAsExpressionSeparator: false
338
- Style/SignalException:
339
- Description: Checks for proper usage of fail and raise.
340
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
341
- Enabled: false
342
- EnforcedStyle: semantic
343
- SupportedStyles:
344
- - only_raise
345
- - only_fail
346
- - semantic
347
- Style/SingleLineBlockParams:
348
- Description: Enforces the names of some block params.
349
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
350
- Enabled: false
351
- Methods:
352
- - reduce:
353
- - a
354
- - e
355
- - inject:
356
- - a
357
- - e
358
- Style/SingleLineMethods:
359
- Description: Avoid single-line methods.
360
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
361
- Enabled: false
362
- AllowIfMethodIsEmpty: true
363
- Style/StringLiterals:
364
- Description: Checks if uses of quotes match the configured preference.
365
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
366
- Enabled: true
367
- EnforcedStyle: single_quotes
368
- SupportedStyles:
369
- - single_quotes
370
- - double_quotes
371
- Style/StringLiteralsInInterpolation:
372
- Description: Checks if uses of quotes inside expressions in interpolated strings
373
- match the configured preference.
374
- Enabled: true
375
- EnforcedStyle: single_quotes
376
- SupportedStyles:
377
- - single_quotes
378
- - double_quotes
379
- Style/SpaceAroundBlockParameters:
380
- Description: Checks the spacing inside and after block parameters pipes.
381
- Enabled: true
382
- EnforcedStyleInsidePipes: no_space
383
- SupportedStyles:
384
- - space
385
- - no_space
386
- Style/SpaceAroundEqualsInParameterDefault:
387
- Description: Checks that the equals signs in parameter default assignments have
388
- or don't have surrounding space depending on configuration.
389
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
390
- Enabled: true
391
- EnforcedStyle: space
392
- SupportedStyles:
393
- - space
394
- - no_space
395
- Style/SpaceBeforeBlockBraces:
396
- Description: Checks that the left block brace has or doesn't have space before it.
397
- Enabled: true
398
- EnforcedStyle: space
399
- SupportedStyles:
400
- - space
401
- - no_space
402
- Style/SpaceInsideBlockBraces:
403
- Description: Checks that block braces have or don't have surrounding space. For
404
- blocks taking parameters, checks that the left brace has or doesn't have trailing
405
- space.
406
- Enabled: true
407
- EnforcedStyle: space
408
- SupportedStyles:
409
- - space
410
- - no_space
411
- EnforcedStyleForEmptyBraces: no_space
412
- SpaceBeforeBlockParameters: true
413
- Style/SpaceInsideHashLiteralBraces:
414
- Description: Use spaces inside hash literal braces - or don't.
415
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
416
- Enabled: true
417
- EnforcedStyle: space
418
- EnforcedStyleForEmptyBraces: no_space
419
- SupportedStyles:
420
- - space
421
- - no_space
422
- Style/SymbolProc:
423
- Description: Use symbols as procs instead of blocks when possible.
424
- Enabled: true
425
- IgnoredMethods:
426
- - respond_to
427
- Style/TrailingBlankLines:
428
- Description: Checks trailing blank lines and final newline.
429
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
430
- Enabled: true
431
- EnforcedStyle: final_newline
432
- SupportedStyles:
433
- - final_newline
434
- - final_blank_line
435
- Style/TrailingComma:
436
- Description: Checks for trailing comma in parameter lists and literals.
437
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
438
- Enabled: false
439
- EnforcedStyleForMultiline: no_comma
440
- SupportedStyles:
441
- - comma
442
- - no_comma
443
- Style/TrivialAccessors:
444
- Description: Prefer attr_* methods to trivial readers/writers.
445
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
446
- Enabled: false
447
- ExactNameMatch: false
448
- AllowPredicates: false
449
- AllowDSLWriters: false
450
- Whitelist:
451
- - to_ary
452
- - to_a
453
- - to_c
454
- - to_enum
455
- - to_h
456
- - to_hash
457
- - to_i
458
- - to_int
459
- - to_io
460
- - to_open
461
- - to_path
462
- - to_proc
463
- - to_r
464
- - to_regexp
465
- - to_str
466
- - to_s
467
- - to_sym
468
- Style/VariableName:
469
- Description: Use the configured style when naming variables.
470
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
471
- Enabled: true
472
- EnforcedStyle: snake_case
473
- SupportedStyles:
474
- - snake_case
475
- - camelCase
476
- Style/WhileUntilModifier:
477
- Description: Favor modifier while/until usage when you have a single-line body.
478
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
479
- Enabled: false
480
- MaxLineLength: 80
481
- Style/WordArray:
482
- Description: Use %w or %W for arrays of words.
483
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
484
- Enabled: false
485
- MinSize: 0
486
- WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
487
- Metrics/AbcSize:
488
- Description: A calculated magnitude based on number of assignments, branches, and
489
- conditions.
490
- Enabled: true
491
- Max: 15
492
- Metrics/BlockNesting:
493
- Description: Avoid excessive block nesting
494
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
495
- Enabled: false
496
- Max: 3
497
- Metrics/ClassLength:
498
- Description: Avoid classes longer than 100 lines of code.
499
- Enabled: false
500
- CountComments: false
501
- Max: 100
502
- Metrics/CyclomaticComplexity:
503
- Description: A complexity metric that is strongly correlated to the number of test
504
- cases needed to validate a method.
505
- Enabled: false
506
- Max: 6
507
- Metrics/LineLength:
508
- Description: Limit lines to 80 characters.
509
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
510
- Enabled: true
511
- Max: 80
512
- AllowURI: true
513
- URISchemes:
514
- - http
515
- - https
516
- Metrics/MethodLength:
517
- Description: Avoid methods longer than 10 lines of code.
518
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
519
- Enabled: false
520
- CountComments: false
521
- Max: 10
522
- Metrics/ParameterLists:
523
- Description: Avoid parameter lists longer than three or four parameters.
524
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
525
- Enabled: false
526
- Max: 5
527
- CountKeywordArgs: true
528
- Metrics/PerceivedComplexity:
529
- Description: A complexity metric geared towards measuring complexity for a human
530
- reader.
531
- Enabled: false
532
- Max: 7
533
- Lint/AssignmentInCondition:
534
- Description: Don't use assignment in conditions.
535
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
536
- Enabled: false
537
- AllowSafeAssignment: true
538
- Lint/EndAlignment:
539
- Description: Align ends correctly.
540
- Enabled: true
541
- AlignWith: keyword
542
- SupportedStyles:
543
- - keyword
544
- - variable
545
- Lint/DefEndAlignment:
546
- Description: Align ends corresponding to defs correctly.
547
- Enabled: true
548
- AlignWith: start_of_line
549
- SupportedStyles:
550
- - start_of_line
551
- - def
552
- Rails/ActionFilter:
553
- Description: Enforces consistent use of action filter methods.
554
- Enabled: false
555
- EnforcedStyle: action
556
- SupportedStyles:
557
- - action
558
- - filter
559
- Include:
560
- - app/controllers/**/*.rb
561
- Rails/DefaultScope:
562
- Description: Checks if the argument passed to default_scope is a block.
563
- Enabled: true
564
- Include:
565
- - app/models/**/*.rb
566
- Rails/HasAndBelongsToMany:
567
- Description: Prefer has_many :through to has_and_belongs_to_many.
568
- Enabled: true
569
- Include:
570
- - app/models/**/*.rb
571
- Rails/Output:
572
- Description: Checks for calls to puts, print, etc.
573
- Enabled: true
574
- Include:
575
- - app/**/*.rb
576
- - config/**/*.rb
577
- - db/**/*.rb
578
- - lib/**/*.rb
579
- Rails/ReadWriteAttribute:
580
- Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
581
- Enabled: true
582
- Include:
583
- - app/models/**/*.rb
584
- Rails/ScopeArgs:
585
- Description: Checks the arguments of ActiveRecord scopes.
586
- Enabled: true
587
- Include:
588
- - app/models/**/*.rb
589
- Rails/Validation:
590
- Description: Use validates :attribute, hash of validations.
591
- Enabled: true
592
- Include:
593
- - app/models/**/*.rb
594
- Style/InlineComment:
595
- Description: Avoid inline comments.
596
- Enabled: false
597
- Style/MethodCalledOnDoEndBlock:
598
- Description: Avoid chaining a method call on a do...end block.
599
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
600
- Enabled: false
601
- Style/SymbolArray:
602
- Description: Use %i or %I for arrays of symbols.
603
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
604
- Enabled: false
605
- Style/ExtraSpacing:
606
- Description: Do not use unnecessary spacing.
607
- Enabled: true
608
- Style/AccessorMethodName:
609
- Description: Check the naming of accessor methods for get_/set_.
610
- Enabled: false
611
- Style/Alias:
612
- Description: Use alias_method instead of alias.
613
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
614
- Enabled: false
615
- Style/AlignArray:
616
- Description: Align the elements of an array literal if they span more than one line.
617
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
618
- Enabled: true
619
- Style/ArrayJoin:
620
- Description: Use Array#join instead of Array#*.
621
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
622
- Enabled: false
623
- Style/AsciiComments:
624
- Description: Use only ascii symbols in comments.
625
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
626
- Enabled: false
627
- Style/AsciiIdentifiers:
628
- Description: Use only ascii symbols in identifiers.
629
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
630
- Enabled: false
631
- Style/Attr:
632
- Description: Checks for uses of Module#attr.
633
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
634
- Enabled: false
635
- Style/BeginBlock:
636
- Description: Avoid the use of BEGIN blocks.
637
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
638
- Enabled: true
639
- Style/BlockComments:
640
- Description: Do not use block comments.
641
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
642
- Enabled: true
643
- Style/BlockEndNewline:
644
- Description: Put end statement of multiline block on its own line.
645
- Enabled: true
646
- Style/Blocks:
647
- Description: Avoid using {...} for multi-line blocks (multiline chaining is always
648
- ugly). Prefer {...} over do...end for single-line blocks.
649
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
650
- Enabled: true
651
- Style/CaseEquality:
652
- Description: Avoid explicit use of the case equality operator(===).
653
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
654
- Enabled: false
655
- Style/CharacterLiteral:
656
- Description: Checks for uses of character literals.
657
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
658
- Enabled: false
659
- Style/ClassAndModuleCamelCase:
660
- Description: Use CamelCase for classes and modules.
661
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
662
- Enabled: true
663
- Style/ClassMethods:
664
- Description: Use self when defining module/class methods.
665
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
666
- Enabled: true
667
- Style/ClassVars:
668
- Description: Avoid the use of class variables.
669
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
670
- Enabled: false
671
- Style/ColonMethodCall:
672
- Description: 'Do not use :: for method call.'
673
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
674
- Enabled: false
675
- Style/CommentIndentation:
676
- Description: Indentation of comments.
677
- Enabled: true
678
- Style/ConstantName:
679
- Description: Constants should use SCREAMING_SNAKE_CASE.
680
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
681
- Enabled: true
682
- Style/DefWithParentheses:
683
- Description: Use def with parentheses when there are arguments.
684
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
685
- Enabled: true
686
- Style/DeprecatedHashMethods:
687
- Description: Checks for use of deprecated Hash methods.
688
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
689
- Enabled: false
690
- Style/Documentation:
691
- Description: Document classes and non-namespace modules.
692
- Enabled: false
693
- Style/DoubleNegation:
694
- Description: Checks for uses of double negation (!!).
695
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
696
- Enabled: false
697
- Style/EachWithObject:
698
- Description: Prefer `each_with_object` over `inject` or `reduce`.
699
- Enabled: false
700
- Style/ElseAlignment:
701
- Description: Align elses and elsifs correctly.
702
- Enabled: true
703
- Style/EmptyElse:
704
- Description: Avoid empty else-clauses.
705
- Enabled: true
706
- Style/EmptyLines:
707
- Description: Don't use several empty lines in a row.
708
- Enabled: true
709
- Style/EmptyLinesAroundAccessModifier:
710
- Description: Keep blank lines around access modifiers.
711
- Enabled: true
712
- Style/EmptyLinesAroundMethodBody:
713
- Description: Keeps track of empty lines around method bodies.
714
- Enabled: true
715
- Style/EmptyLiteral:
716
- Description: Prefer literals to Array.new/Hash.new/String.new.
717
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
718
- Enabled: false
719
- Style/EndBlock:
720
- Description: Avoid the use of END blocks.
721
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
722
- Enabled: true
723
- Style/EndOfLine:
724
- Description: Use Unix-style line endings.
725
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
726
- Enabled: true
727
- Style/EvenOdd:
728
- Description: Favor the use of Fixnum#even? && Fixnum#odd?
729
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
730
- Enabled: false
731
- Style/FlipFlop:
732
- Description: Checks for flip flops
733
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
734
- Enabled: false
735
- Style/IfWithSemicolon:
736
- Description: Do not use if x; .... Use the ternary operator instead.
737
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
738
- Enabled: false
739
- Style/IndentationConsistency:
740
- Description: Keep indentation straight.
741
- Enabled: true
742
- Style/IndentArray:
743
- Description: Checks the indentation of the first element in an array literal.
744
- Enabled: true
745
- Style/InfiniteLoop:
746
- Description: Use Kernel#loop for infinite loops.
747
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
748
- Enabled: true
749
- Style/Lambda:
750
- Description: Use the new lambda literal syntax for single-line blocks.
751
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
752
- Enabled: false
753
- Style/LeadingCommentSpace:
754
- Description: Comments should start with a space.
755
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
756
- Enabled: true
757
- Style/LineEndConcatenation:
758
- Description: Use \ instead of + or << to concatenate two string literals at line
759
- end.
760
- Enabled: false
761
- Style/MethodCallParentheses:
762
- Description: Do not use parentheses for method calls with no arguments.
763
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
764
- Enabled: true
765
- Style/ModuleFunction:
766
- Description: Checks for usage of `extend self` in modules.
767
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
768
- Enabled: false
769
- Style/MultilineBlockChain:
770
- Description: Avoid multi-line chains of blocks.
771
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
772
- Enabled: true
773
- Style/MultilineBlockLayout:
774
- Description: Ensures newlines after multiline block do statements.
775
- Enabled: true
776
- Style/MultilineIfThen:
777
- Description: Do not use then for multi-line if/unless.
778
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
779
- Enabled: true
780
- Style/MultilineTernaryOperator:
781
- Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
782
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
783
- Enabled: true
784
- Style/NegatedIf:
785
- Description: Favor unless over if for negative conditions (or control flow or).
786
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
787
- Enabled: false
788
- Style/NegatedWhile:
789
- Description: Favor until over while for negative conditions.
790
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
791
- Enabled: false
792
- Style/NestedTernaryOperator:
793
- Description: Use one expression per branch in a ternary operator.
794
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
795
- Enabled: true
796
- Style/NilComparison:
797
- Description: Prefer x.nil? to x == nil.
798
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
799
- Enabled: false
800
- Style/Not:
801
- Description: Use ! instead of not.
802
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
803
- Enabled: false
804
- Style/OneLineConditional:
805
- Description: Favor the ternary operator(?:) over if/then/else/end constructs.
806
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
807
- Enabled: false
808
- Style/OpMethod:
809
- Description: When defining binary operators, name the argument other.
810
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
811
- Enabled: false
812
- Style/PerlBackrefs:
813
- Description: Avoid Perl-style regex back references.
814
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
815
- Enabled: false
816
- Style/Proc:
817
- Description: Use proc instead of Proc.new.
818
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
819
- Enabled: false
820
- Style/RedundantBegin:
821
- Description: Don't use begin blocks when they are not needed.
822
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
823
- Enabled: true
824
- Style/RedundantException:
825
- Description: Checks for an obsolete RuntimeException argument in raise/fail.
826
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
827
- Enabled: true
828
- Style/RedundantSelf:
829
- Description: Don't use self where it's not needed.
830
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
831
- Enabled: true
832
- Style/RescueModifier:
833
- Description: Avoid using rescue in its modifier form.
834
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
835
- Enabled: true
836
- Style/SelfAssignment:
837
- Description: Checks for places where self-assignment shorthand should have been
838
- used.
839
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
840
- Enabled: false
841
- Style/SingleSpaceBeforeFirstArg:
842
- Description: Checks that exactly one space is used between a method name and the
843
- first argument for method calls without parentheses.
844
- Enabled: true
845
- Style/SpaceAfterColon:
846
- Description: Use spaces after colons.
847
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
848
- Enabled: true
849
- Style/SpaceAfterComma:
850
- Description: Use spaces after commas.
851
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
852
- Enabled: true
853
- Style/SpaceAfterControlKeyword:
854
- Description: Use spaces after if/elsif/unless/while/until/case/when.
855
- Enabled: true
856
- Style/SpaceAfterMethodName:
857
- Description: Do not put a space between a method name and the opening parenthesis
858
- in a method definition.
859
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
860
- Enabled: true
861
- Style/SpaceAfterNot:
862
- Description: Tracks redundant space after the ! operator.
863
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
864
- Enabled: true
865
- Style/SpaceAfterSemicolon:
866
- Description: Use spaces after semicolons.
867
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
868
- Enabled: true
869
- Style/SpaceBeforeComma:
870
- Description: No spaces before commas.
871
- Enabled: true
872
- Style/SpaceBeforeComment:
873
- Description: Checks for missing space between code and a comment on the same line.
874
- Enabled: true
875
- Style/SpaceBeforeSemicolon:
876
- Description: No spaces before semicolons.
877
- Enabled: true
878
- Style/SpaceAroundOperators:
879
- Description: Use spaces around operators.
880
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
881
- Enabled: true
882
- Style/SpaceBeforeModifierKeyword:
883
- Description: Put a space before the modifier keyword.
884
- Enabled: true
885
- Style/SpaceInsideBrackets:
886
- Description: No spaces after [ or before ].
887
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
888
- Enabled: true
889
- Style/SpaceInsideParens:
890
- Description: No spaces after ( or before ).
891
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
892
- Enabled: true
893
- Style/SpaceInsideRangeLiteral:
894
- Description: No spaces inside range literals.
895
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
896
- Enabled: true
897
- Style/SpecialGlobalVars:
898
- Description: Avoid Perl-style global variables.
899
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
900
- Enabled: false
901
- Style/StructInheritance:
902
- Description: Checks for inheritance from Struct.new.
903
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
904
- Enabled: true
905
- Style/Tab:
906
- Description: No hard tabs.
907
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
908
- Enabled: true
909
- Style/TrailingWhitespace:
910
- Description: Avoid trailing whitespace.
911
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
912
- Enabled: true
913
- Style/UnlessElse:
914
- Description: Do not use unless with else. Rewrite these with the positive case first.
915
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
916
- Enabled: true
917
- Style/UnneededCapitalW:
918
- Description: Checks for %W when interpolation is not needed.
919
- Enabled: true
920
- Style/UnneededPercentQ:
921
- Description: Checks for %q/%Q when single quotes or double quotes would do.
922
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
923
- Enabled: true
924
- Style/UnneededPercentX:
925
- Description: Checks for %x when `` would do.
926
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
927
- Enabled: true
928
- Style/VariableInterpolation:
929
- Description: Don't interpolate global, instance and class variables directly in
930
- strings.
931
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
932
- Enabled: false
933
- Style/WhenThen:
934
- Description: Use when x then ... for one-line cases.
935
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
936
- Enabled: false
937
- Style/WhileUntilDo:
938
- Description: Checks for redundant do after while or until.
939
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
940
- Enabled: true
941
- Lint/AmbiguousOperator:
942
- Description: Checks for ambiguous operators in the first argument of a method invocation
943
- without parentheses.
944
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
945
- Enabled: false
946
- Lint/AmbiguousRegexpLiteral:
947
- Description: Checks for ambiguous regexp literals in the first argument of a method
948
- invocation without parenthesis.
949
- Enabled: false
950
- Lint/BlockAlignment:
951
- Description: Align block ends correctly.
952
- Enabled: true
953
- Lint/ConditionPosition:
954
- Description: Checks for condition placed in a confusing position relative to the
955
- keyword.
956
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
957
- Enabled: false
958
- Lint/Debugger:
959
- Description: Check for debugger calls.
960
- Enabled: true
961
- Lint/DeprecatedClassMethods:
962
- Description: Check for deprecated class method calls.
963
- Enabled: false
964
- Lint/DuplicateMethods:
965
- Description: Check for duplicate methods calls.
966
- Enabled: true
967
- Lint/ElseLayout:
968
- Description: Check for odd code arrangement in an else block.
969
- Enabled: false
970
- Lint/EmptyEnsure:
971
- Description: Checks for empty ensure block.
972
- Enabled: true
973
- Lint/EmptyInterpolation:
974
- Description: Checks for empty string interpolation.
975
- Enabled: true
976
- Lint/EndInMethod:
977
- Description: END blocks should not be placed inside method definitions.
978
- Enabled: true
979
- Lint/EnsureReturn:
980
- Description: Do not use return in an ensure block.
981
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
982
- Enabled: true
983
- Lint/Eval:
984
- Description: The use of eval represents a serious security risk.
985
- Enabled: true
986
- Lint/HandleExceptions:
987
- Description: Don't suppress exception.
988
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
989
- Enabled: false
990
- Lint/InvalidCharacterLiteral:
991
- Description: Checks for invalid character literals with a non-escaped whitespace
992
- character.
993
- Enabled: false
994
- Lint/LiteralInCondition:
995
- Description: Checks of literals used in conditions.
996
- Enabled: false
997
- Lint/LiteralInInterpolation:
998
- Description: Checks for literals used in interpolation.
999
- Enabled: false
1000
- Lint/Loop:
1001
- Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
1002
- for post-loop tests.
1003
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
1004
- Enabled: false
1005
- Lint/ParenthesesAsGroupedExpression:
1006
- Description: Checks for method calls with a space before the opening parenthesis.
1007
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
1008
- Enabled: false
1009
- Lint/RequireParentheses:
1010
- Description: Use parentheses in the method call to avoid confusion about precedence.
1011
- Enabled: false
1012
- Lint/RescueException:
1013
- Description: Avoid rescuing the Exception class.
1014
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
1015
- Enabled: true
1016
- Lint/ShadowingOuterLocalVariable:
1017
- Description: Do not use the same name as outer local variable for block arguments
1018
- or block local variables.
1019
- Enabled: true
1020
- Lint/SpaceBeforeFirstArg:
1021
- Description: Put a space between a method name and the first argument in a method
1022
- call without parentheses.
1023
- Enabled: true
1024
- Lint/StringConversionInInterpolation:
1025
- Description: Checks for Object#to_s usage in string interpolation.
1026
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
1027
- Enabled: true
1028
- Lint/UnderscorePrefixedVariableName:
1029
- Description: Do not use prefix `_` for a variable that is used.
1030
- Enabled: false
1031
- Lint/UnusedBlockArgument:
1032
- Description: Checks for unused block arguments.
1033
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1034
- Enabled: true
1035
- Lint/UnusedMethodArgument:
1036
- Description: Checks for unused method arguments.
1037
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1038
- Enabled: true
1039
- Lint/UnreachableCode:
1040
- Description: Unreachable code.
1041
- Enabled: true
1042
- Lint/UselessAccessModifier:
1043
- Description: Checks for useless access modifiers.
1044
- Enabled: true
1045
- Lint/UselessAssignment:
1046
- Description: Checks for useless assignment to a local variable.
1047
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1048
- Enabled: true
1049
- Lint/UselessComparison:
1050
- Description: Checks for comparison of something with itself.
1051
- Enabled: true
1052
- Lint/UselessElseWithoutRescue:
1053
- Description: Checks for useless `else` in `begin..end` without `rescue`.
1054
- Enabled: true
1055
- Lint/UselessSetterCall:
1056
- Description: Checks for useless setter call to a local variable.
1057
- Enabled: true
1058
- Lint/Void:
1059
- Description: Possible use of operator/literal/variable in void context.
1060
- Enabled: false
1061
- Rails/Delegate:
1062
- Description: Prefer delegate method for delegations.
1063
- Enabled: false