thanx-style 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9f84bfbbefcbf9f052a2da73f746407f33547e3530aee03d8223f14f44ac7a6
4
- data.tar.gz: ba8ede7e11b37a233631880608271c0c7f75ebd3963456c47ef419cd4cee877b
3
+ metadata.gz: a6326a8eda342a3ba4e19a1edf557cce05e31b9f84f487025714134650b351a9
4
+ data.tar.gz: 5e5338ea5d44d16e1cead2722f7d28c7e4724651a983978a89ab689a0cdd001c
5
5
  SHA512:
6
- metadata.gz: 1bec9d3aee353363bfeef80cda1d1341c480dc5bfa911fd4530ca75364b58cf21a7523aeb59db65576cb11f2e8b441f684fe1e0f70470d906b23e88f5ec4b16e
7
- data.tar.gz: 4ffadcecb7109c1d46722445fb2eeeb3b96a9620a166187574a5826b071847a29f038215be99c41cfbb8a48fcdda392e63107694fa431921f2545dba1e176cb3
6
+ metadata.gz: 12ff79358360789eac653fcb5393c51df36a85dbfa6cf3578c9241a9357b31157a30563585caa267a3caacab218def9e5ab88c41d4f46315a9484b9ddb3bbbc3
7
+ data.tar.gz: 699bb7c1e402f7b6ed85712b06c4d8d964b9bf52ec52264b7368b726d8c29e15cb53d40b411a9fa2efe9d2b24983ab26d51941645a52afcac4f77683fd084125
@@ -0,0 +1,15 @@
1
+ Rails/SafeNavigation:
2
+ Description: Converts usages of try! or try to &..
3
+ ConvertTry: true
4
+
5
+ Rails/SkipsModelValidations:
6
+ Exclude:
7
+ - 'db/migrate/*'
8
+
9
+ Rails/UnknownEnv:
10
+ Environments:
11
+ - development
12
+ - test
13
+ - production
14
+ - staging
15
+ - demo
@@ -0,0 +1,54 @@
1
+ RSpec/ContextWording:
2
+ Description: "`context` block descriptions should start with 'when', or 'with'."
3
+ Enabled: false
4
+ StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
5
+
6
+ RSpec/DescribeClass:
7
+ Description: Check that the first argument to the top level describe is a constant.
8
+ Enabled: true
9
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
10
+ Exclude:
11
+ - 'spec/requests/**/*'
12
+
13
+ RSpec/ExampleLength:
14
+ Description: Checks for long examples.
15
+ Enabled: true
16
+ Max: 20
17
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
18
+
19
+ RSpec/ExpectChange:
20
+ Description: Checks for consistent style of change matcher.
21
+ Enabled: true
22
+ EnforcedStyle: block
23
+ SupportedStyles:
24
+ - method_call
25
+ - block
26
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
27
+
28
+ RSpec/ImplicitExpect:
29
+ Description: Check that a consistent implicit expectation style is used.
30
+ Enabled: true
31
+ EnforcedStyle: should
32
+ SupportedStyles:
33
+ - is_expected
34
+ - should
35
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
36
+
37
+ RSpec/MessageSpies:
38
+ Description: Checks that message expectations are set using spies.
39
+ Enabled: true
40
+ EnforcedStyle: receive
41
+ SupportedStyles:
42
+ - have_received
43
+ - receive
44
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
45
+
46
+ RSpec/NestedGroups:
47
+ Description: Checks for nested example groups.
48
+ Enabled: true
49
+ Max: 6
50
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups
51
+
52
+ RSpec/LetSetup:
53
+ Description: Checks unreferenced let! calls being used for test setup.
54
+ Enabled: false
data/.rubocop-ruby.yml ADDED
@@ -0,0 +1,408 @@
1
+ #################### Layout ###########################
2
+
3
+ # Indent private/protected/public as deep as method definitions
4
+ Layout/AccessModifierIndentation:
5
+ EnforcedStyle: outdent
6
+ SupportedStyles:
7
+ - outdent
8
+ - indent
9
+ # By default, the indentation width from Layout/IndentationWidth is used
10
+ # But it can be overridden by setting this parameter
11
+ IndentationWidth: ~
12
+
13
+ # Align the elements of a hash literal if they span more than one line.
14
+ Layout/AlignHash:
15
+ # Alignment of entries using hash rocket as separator. Valid values are:
16
+ #
17
+ # key - left alignment of keys
18
+ # 'a' => 2
19
+ # 'bb' => 3
20
+ # separator - alignment of hash rockets, keys are right aligned
21
+ # 'a' => 2
22
+ # 'bb' => 3
23
+ # table - left alignment of keys, hash rockets, and values
24
+ # 'a' => 2
25
+ # 'bb' => 3
26
+ EnforcedHashRocketStyle: table
27
+ SupportedHashRocketStyles:
28
+ - key
29
+ - separator
30
+ - table
31
+ # Alignment of entries using colon as separator. Valid values are:
32
+ #
33
+ # key - left alignment of keys
34
+ # a: 0
35
+ # bb: 1
36
+ # separator - alignment of colons, keys are right aligned
37
+ # a: 0
38
+ # bb: 1
39
+ # table - left alignment of keys and values
40
+ # a: 0
41
+ # bb: 1
42
+ EnforcedColonStyle: table
43
+ SupportedColonStyles:
44
+ - key
45
+ - separator
46
+ - table
47
+
48
+ Layout/AlignParameters:
49
+ # Alignment of parameters in multi-line method calls.
50
+ #
51
+ # The `with_first_parameter` style aligns the following lines along the same
52
+ # column as the first parameter.
53
+ #
54
+ # method_call(a,
55
+ # b)
56
+ #
57
+ # The `with_fixed_indentation` style aligns the following lines with one
58
+ # level of indentation relative to the start of the line with the method call.
59
+ #
60
+ # method_call(a,
61
+ # b)
62
+ EnforcedStyle: with_fixed_indentation
63
+ SupportedStyles:
64
+ - with_first_parameter
65
+ - with_fixed_indentation
66
+ # By default, the indentation width from Layout/IndentationWidth is used
67
+ # But it can be overridden by setting this parameter
68
+ IndentationWidth: ~
69
+
70
+ # Indentation of `when`.
71
+ Layout/CaseIndentation:
72
+ EnforcedStyle: end
73
+ SupportedStyles:
74
+ - case
75
+ - end
76
+ IndentOneStep: false
77
+ # By default, the indentation width from `Layout/IndentationWidth` is used.
78
+ # But it can be overridden by setting this parameter.
79
+ # This only matters if `IndentOneStep` is `true`
80
+ IndentationWidth: ~
81
+
82
+ # Align ends correctly.
83
+ Layout/EndAlignment:
84
+ # The value `keyword` means that `end` should be aligned with the matching
85
+ # keyword (`if`, `while`, etc.).
86
+ # The value `variable` means that in assignments, `end` should be aligned
87
+ # with the start of the variable on the left hand side of `=`. In all other
88
+ # situations, `end` should still be aligned with the keyword.
89
+ # The value `start_of_line` means that `end` should be aligned with the start
90
+ # of the line which the matching keyword appears on.
91
+ EnforcedStyleAlignWith: variable
92
+ SupportedStylesAlignWith:
93
+ - keyword
94
+ - variable
95
+ - start_of_line
96
+ AutoCorrect: false
97
+ Severity: warning
98
+
99
+ # Checks the indentation of the first element in an array literal.
100
+ Layout/IndentArray:
101
+ # The value `special_inside_parentheses` means that array literals with
102
+ # brackets that have their opening bracket on the same line as a surrounding
103
+ # opening round parenthesis, shall have their first element indented relative
104
+ # to the first position inside the parenthesis.
105
+ #
106
+ # The value `consistent` means that the indentation of the first element shall
107
+ # always be relative to the first position of the line where the opening
108
+ # bracket is.
109
+ #
110
+ # The value `align_brackets` means that the indentation of the first element
111
+ # shall always be relative to the position of the opening bracket.
112
+ EnforcedStyle: consistent
113
+ SupportedStyles:
114
+ - special_inside_parentheses
115
+ - consistent
116
+ - align_brackets
117
+ # By default, the indentation width from `Layout/IndentationWidth` is used
118
+ # But it can be overridden by setting this parameter
119
+ IndentationWidth: ~
120
+
121
+ # Checks the indentation of the first key in a hash literal.
122
+ Layout/IndentHash:
123
+ # The value `special_inside_parentheses` means that hash literals with braces
124
+ # that have their opening brace on the same line as a surrounding opening
125
+ # round parenthesis, shall have their first key indented relative to the
126
+ # first position inside the parenthesis.
127
+ #
128
+ # The value `consistent` means that the indentation of the first key shall
129
+ # always be relative to the first position of the line where the opening
130
+ # brace is.
131
+ #
132
+ # The value `align_braces` means that the indentation of the first key shall
133
+ # always be relative to the position of the opening brace.
134
+ EnforcedStyle: consistent
135
+ SupportedStyles:
136
+ - special_inside_parentheses
137
+ - consistent
138
+ - align_braces
139
+ # By default, the indentation width from `Layout/IndentationWidth` is used
140
+ # But it can be overridden by setting this parameter
141
+ IndentationWidth: ~
142
+
143
+ Layout/MultilineMethodCallIndentation:
144
+ EnforcedStyle: indented
145
+ SupportedStyles:
146
+ - aligned
147
+ - indented
148
+ - indented_relative_to_receiver
149
+ # By default, the indentation width from Layout/IndentationWidth is used
150
+ # But it can be overridden by setting this parameter
151
+ IndentationWidth: ~
152
+
153
+ # Checks that the equals signs in parameter default assignments have or don't
154
+ # have surrounding space depending on configuration.
155
+ Layout/SpaceAroundEqualsInParameterDefault:
156
+ EnforcedStyle: no_space
157
+ SupportedStyles:
158
+ - space
159
+ - no_space
160
+
161
+ #################### Naming ##########################
162
+
163
+ Naming/UncommunicativeMethodParamName:
164
+ # Parameter names may be equal to or greater than this value
165
+ MinNameLength: 3
166
+ AllowNamesEndingInNumbers: true
167
+ # Whitelisted names that will not register an offense
168
+ AllowedNames:
169
+ - io
170
+ - id
171
+ - to
172
+ - by
173
+ - 'on'
174
+ - in
175
+ - at
176
+ - _
177
+ # Blacklisted names that will register an offense
178
+ ForbiddenNames: []
179
+
180
+ #################### Style ###########################
181
+
182
+ Style/BlockDelimiters:
183
+ EnforcedStyle: line_count_based
184
+ SupportedStyles:
185
+ # The `line_count_based` style enforces braces around single line blocks and
186
+ # do..end around multi-line blocks.
187
+ - line_count_based
188
+ # The `semantic` style enforces braces around functional blocks, where the
189
+ # primary purpose of the block is to return a value and do..end for
190
+ # procedural blocks, where the primary purpose of the block is its
191
+ # side-effects.
192
+ #
193
+ # This looks at the usage of a block's method to determine its type (e.g. is
194
+ # the result of a `map` assigned to a variable or passed to another
195
+ # method) but exceptions are permitted in the `ProceduralMethods`,
196
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
197
+ - semantic
198
+ # The `braces_for_chaining` style enforces braces around single line blocks
199
+ # and do..end around multi-line blocks, except for multi-line blocks whose
200
+ # return value is being chained with another method (in which case braces
201
+ # are enforced).
202
+ - braces_for_chaining
203
+ ProceduralMethods:
204
+ # Methods that are known to be procedural in nature but look functional from
205
+ # their usage, e.g.
206
+ #
207
+ # time = Benchmark.realtime do
208
+ # foo.bar
209
+ # end
210
+ #
211
+ # Here, the return value of the block is discarded but the return value of
212
+ # `Benchmark.realtime` is used.
213
+ - benchmark
214
+ - bm
215
+ - bmbm
216
+ - create
217
+ - each_with_object
218
+ - measure
219
+ - new
220
+ - realtime
221
+ - tap
222
+ - with_object
223
+ FunctionalMethods:
224
+ # Methods that are known to be functional in nature but look procedural from
225
+ # their usage, e.g.
226
+ #
227
+ # let(:foo) { Foo.new }
228
+ #
229
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
230
+ # doesn't appear to be used from the return value of `let`.
231
+ - subject
232
+ - watch
233
+ - before
234
+ IgnoredMethods:
235
+ # Methods that can be either procedural or functional and cannot be
236
+ # categorised from their usage alone, e.g.
237
+ #
238
+ # foo = lambda do |x|
239
+ # puts "Hello, #{x}"
240
+ # end
241
+ #
242
+ # foo = lambda do |x|
243
+ # x * 100
244
+ # end
245
+ #
246
+ # Here, it is impossible to tell from the return value of `lambda` whether
247
+ # the inner block's return value is significant.
248
+ - lambda
249
+ - proc
250
+ - it
251
+ - let
252
+ - let!
253
+ - expect
254
+ Exclude:
255
+ - 'spec/factories.rb'
256
+
257
+ Style/BracesAroundHashParameters:
258
+ EnforcedStyle: context_dependent
259
+ SupportedStyles:
260
+ # The `braces` style enforces braces around all method parameters that are
261
+ # hashes.
262
+ - braces
263
+ # The `no_braces` style checks that the last parameter doesn't have braces
264
+ # around it.
265
+ - no_braces
266
+ # The `context_dependent` style checks that the last parameter doesn't have
267
+ # braces around it, but requires braces if the second to last parameter is
268
+ # also a hash literal.
269
+ - context_dependent
270
+
271
+ Style/ClassAndModuleChildren:
272
+ # Checks the style of children definitions at classes and modules.
273
+ #
274
+ # Basically there are two different styles:
275
+ #
276
+ # `nested` - have each child on a separate line
277
+ # class Foo
278
+ # class Bar
279
+ # end
280
+ # end
281
+ #
282
+ # `compact` - combine definitions as much as possible
283
+ # class Foo::Bar
284
+ # end
285
+ #
286
+ # The compact style is only forced, for classes or modules with one child.
287
+ EnforcedStyle: compact
288
+ SupportedStyles:
289
+ - nested
290
+ - compact
291
+
292
+ # Allow empty condition in case statements
293
+ Style/EmptyCaseCondition:
294
+ Enabled: false
295
+
296
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or
297
+ # `unless` needs to have to trigger this cop
298
+ Style/GuardClause:
299
+ MinBodyLength: 1
300
+ Exclude:
301
+ - 'db/migrate/*'
302
+
303
+ Style/MultilineMemoization:
304
+ EnforcedStyle: braces
305
+ SupportedStyles:
306
+ - keyword
307
+ - braces
308
+
309
+ Style/StringLiterals:
310
+ EnforcedStyle: single_quotes
311
+ SupportedStyles:
312
+ - single_quotes
313
+ - double_quotes
314
+ # If `true`, strings which span multiple lines using `\` for continuation must
315
+ # use the same type of quotes on each line.
316
+ ConsistentQuotesInMultiline: true
317
+
318
+ Style/SymbolArray:
319
+ EnforcedStyle: brackets
320
+ MinSize: 2
321
+ SupportedStyles:
322
+ - percent
323
+ - brackets
324
+
325
+ # `WordArray` enforces how array literals of word-like strings should be expressed.
326
+ Style/WordArray:
327
+ EnforcedStyle: brackets
328
+ SupportedStyles:
329
+ # percent style: %w(word1 word2)
330
+ - percent
331
+ # bracket style: ['word1', 'word2']
332
+ - brackets
333
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
334
+ # smaller than a certain size. The rule is only applied to arrays
335
+ # whose element count is greater than or equal to `MinSize`.
336
+ MinSize: 1
337
+ # The regular expression `WordRegex` decides what is considered a word.
338
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
339
+
340
+ #################### Metrics ###############################
341
+
342
+ Metrics/AbcSize:
343
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
344
+ # a Float.
345
+ Max: 20
346
+ Exclude:
347
+ - 'db/migrate/*'
348
+
349
+ Metrics/BlockLength:
350
+ CountComments: false # count full line comments?
351
+ Max: 25
352
+ ExcludedMethods:
353
+ - aasm # AAM
354
+ - factory # FactoryBot factory
355
+ - resource # Grape resource
356
+ - FactoryBot.define # FactoryBot define
357
+ Exclude:
358
+ - '**/*_spec.rb'
359
+
360
+ Metrics/ClassLength:
361
+ CountComments: false # count full line comments?
362
+ Max: 200
363
+
364
+ # Avoid complex methods.
365
+ Metrics/CyclomaticComplexity:
366
+ Max: 10
367
+
368
+ Metrics/LineLength:
369
+ Max: 80
370
+ # To make it possible to copy or click on URIs in the code, we allow lines
371
+ # containing a URI to be longer than Max.
372
+ AllowHeredoc: true
373
+ AllowURI: true
374
+ URISchemes:
375
+ - http
376
+ - https
377
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
378
+ # directives like '# rubocop: enable ...' when calculating a line's length.
379
+ IgnoreCopDirectives: false
380
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
381
+ # elements. Strings will be converted to Regexp objects. A line that matches
382
+ # any regular expression listed in this option will be ignored by LineLength.
383
+ IgnoredPatterns: []
384
+ Exclude:
385
+ - 'db/migrate/*'
386
+ - 'config/**/*'
387
+
388
+ Metrics/MethodLength:
389
+ CountComments: false # count full line comments?
390
+ Max: 20
391
+ Exclude:
392
+ - 'db/migrate/*'
393
+
394
+ Metrics/PerceivedComplexity:
395
+ Max: 10
396
+
397
+ #################### Lint ##################################
398
+
399
+ Lint/AmbiguousBlockAssociation:
400
+ Exclude:
401
+ - "spec/**/*"
402
+
403
+ #################### Bundler ###############################
404
+
405
+ Bundler/OrderedGems:
406
+ Description: A Gem's requirements should be listed only once in a Gemfile.
407
+ Enabled: true
408
+ TreatCommentsAsGroupSeparators: false
data/.rubocop.yml ADDED
@@ -0,0 +1,25 @@
1
+ AllCops:
2
+ TargetRailsVersion: 5.1.4
3
+ TargetRubyVersion: 2.5.0
4
+ Exclude:
5
+ - '**/vendor/**/*'
6
+ - '.git/**/*'
7
+ - 'db/schema.rb'
8
+ - '**/bin/**/*'
9
+
10
+ DefaultFormatter: progress
11
+ DisplayCopNames: true
12
+ ExtraDetails: true
13
+
14
+ Rails:
15
+ Enabled: true
16
+
17
+ require: rubocop-rspec
18
+
19
+ inherit_from:
20
+ - .rubocop-ruby.yml
21
+ - .rubocop-rspec.yml
22
+ - .rubocop-rails.yml
23
+
24
+ Documentation:
25
+ Enabled: false
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Thanx # rubocop:disable Style/ClassAndModuleChildren
4
4
  class Style
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thanx-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eng @ Thanx
@@ -61,6 +61,10 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
+ - ".rubocop-rails.yml"
65
+ - ".rubocop-rspec.yml"
66
+ - ".rubocop-ruby.yml"
67
+ - ".rubocop.yml"
64
68
  - lib/thanx/style.rb
65
69
  - lib/thanx/style/version.rb
66
70
  homepage: https://github.com/thanx/style-guide