radius-spec 0.3.0 → 0.4.0
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 +4 -4
- data/CHANGELOG.md +29 -0
- data/common_rubocop.yml +124 -16
- data/common_rubocop_rails.yml +59 -3
- data/lib/radius/spec/rails.rb +1 -1
- data/lib/radius/spec/version.rb +1 -1
- data/radius-spec.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36a2686c3a5c78dd53ae5155196068a0c363b438edf1e84f64212ce8e7ffe905
|
4
|
+
data.tar.gz: 3600656a4e89595218980fa536a785b94494e5396bb10ecf294cc3741f1a693b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b81229f457df7c5ea6e6d1984ff2d68323b6c1acab81c5c4ede9001ed97f7619f2b355de636f4e72560412185b13c2ec804fc78866d5dcef1e258cde58ddee
|
7
|
+
data.tar.gz: c48a00ab090ace41b513c2007e55ece0aa8b4341bf0747f3aad5f0d11bf11c6745f64fca02d5150ff15f0f72cf1dafc49ed95985b4e744a5f291ea5e247f1eb2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
## 0.4.0 (July 10, 2018)
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/RadiusNetworks/radius-spec/compare/v0.3.0...v0.4.0)
|
4
|
+
|
5
|
+
### Enhancements
|
6
|
+
|
7
|
+
- Upgrade to Rubocop 0.58.x (Aaron Kromer, #10)
|
8
|
+
- Add more custom extra details for customized cops (Aaron Kromer, #10)
|
9
|
+
- Adjust common Rubocop configuration
|
10
|
+
- Disable `Naming/BinaryOperatorParameterName` (Aaron Kromer, #7)
|
11
|
+
- Disable `Style/RedundantReturn` (Aaron Kromer, #7)
|
12
|
+
- Allow optional leading underscores for memoized instance variable names to
|
13
|
+
support modules wanting to reduce conflicts / collisions. (Aaron Kromer, #10)
|
14
|
+
- Adjust common Rubocop Rails configuration (Aaron Kromer, #7)
|
15
|
+
- Exclude Rails controllers from Rubocop's `Metrics/MethodLength` due to
|
16
|
+
`respond_to` / `format` and permitted params methods
|
17
|
+
- Disable `Rails/HasAndBelongsToMany`
|
18
|
+
- Exclude Rails app `config/routes.rb` from `Metrics/BlockLength`
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
- Add more functional methods to Rubocop config (Aaron Kromer, #7)
|
23
|
+
- `create`
|
24
|
+
- `create!`
|
25
|
+
- `build`
|
26
|
+
- `build!`
|
27
|
+
- Support running system specs in isolation (Aaron Kromer, #9)
|
28
|
+
|
29
|
+
|
1
30
|
## 0.3.0 (June 15, 2018)
|
2
31
|
|
3
32
|
[Full Changelog](https://github.com/RadiusNetworks/radius-spec/compare/v0.2.1...v0.3.0)
|
data/common_rubocop.yml
CHANGED
@@ -13,12 +13,16 @@ AllCops:
|
|
13
13
|
# Exclude vendored content
|
14
14
|
- 'vendor/**/*'
|
15
15
|
|
16
|
-
#
|
17
|
-
# class
|
16
|
+
# We prefer outdented access modifiers as we feel they provide demarcation of
|
17
|
+
# the class similar to `rescue` and `ensure` in a method.
|
18
18
|
#
|
19
|
-
# Configuration parameters: EnforcedStyle,
|
19
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
20
20
|
# SupportedStyles: outdent, indent
|
21
21
|
Layout/AccessModifierIndentation:
|
22
|
+
Details: |
|
23
|
+
|
24
|
+
Prefer outdented access modifiers to provide demarcation of the class
|
25
|
+
similar to `rescue` and `ensure` in a method.
|
22
26
|
EnforcedStyle: outdent
|
23
27
|
|
24
28
|
# Disabling this until it is fixed to support multi-line block chains using the
|
@@ -34,7 +38,7 @@ Layout/BlockAlignment:
|
|
34
38
|
# Disabling this until it is fixed to handle multi-line method chains where the
|
35
39
|
# first method call is multi-line.
|
36
40
|
#
|
37
|
-
# See
|
41
|
+
# See https://github.com/bbatsov/rubocop/issues/5650
|
38
42
|
#
|
39
43
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
40
44
|
# SupportedStyles: consistent, consistent_relative_to_receiver,
|
@@ -51,14 +55,15 @@ Layout/FirstParameterIndentation:
|
|
51
55
|
Layout/IndentHeredoc:
|
52
56
|
EnforcedStyle: squiggly
|
53
57
|
|
54
|
-
# We tend to indent multi-line operation statements. I think this is because
|
55
|
-
#
|
56
|
-
#
|
58
|
+
# We tend to indent multi-line operation statements. I think this is because it
|
59
|
+
# tends to be the default style auto-formatted by VIM (which many of us use).
|
60
|
+
# It also helps show the continuation of the statement instead of it
|
57
61
|
# potentially blending in with the start of the next statement.
|
58
62
|
#
|
59
63
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
60
64
|
# SupportedStyles: aligned, indented
|
61
65
|
Layout/MultilineOperationIndentation:
|
66
|
+
Details: "This helps show expression continuation setting it apart from the following LOC."
|
62
67
|
EnforcedStyle: indented
|
63
68
|
|
64
69
|
# In our specs Rubocop inconsistently complains when using the block form of
|
@@ -83,7 +88,7 @@ Lint/AmbiguousBlockAssociation:
|
|
83
88
|
Exclude:
|
84
89
|
- 'spec/**/*_spec.rb'
|
85
90
|
|
86
|
-
# Often with benchmarking we don't
|
91
|
+
# Often with benchmarking we don't explicitly "use" a variable or return value.
|
87
92
|
# We simply need to perform the operation which generates said value for the
|
88
93
|
# benchmark.
|
89
94
|
#
|
@@ -93,6 +98,7 @@ Lint/Void:
|
|
93
98
|
- 'benchmarks/**/*'
|
94
99
|
|
95
100
|
# Configuration parameters: CountComments, ExcludedMethods, Max.
|
101
|
+
# ExcludedMethods: refine
|
96
102
|
Metrics/BlockLength:
|
97
103
|
Exclude:
|
98
104
|
- '**/Rakefile'
|
@@ -134,6 +140,14 @@ Metrics/LineLength:
|
|
134
140
|
- '\A.{1,78}\s#\s.*\z'
|
135
141
|
Max: 100
|
136
142
|
|
143
|
+
# This is overly pedantic (only allowing `other` as the parameter name). Ruby
|
144
|
+
# core doesn't follow this consistently either. Looking at several classes
|
145
|
+
# throughout Ruby core we do often see `other`, but also often `obj` or
|
146
|
+
# `other_*`. In some cases, the parameter is named more meaningfully with names
|
147
|
+
# like `real`, `numeric`, or `str`.
|
148
|
+
Naming/BinaryOperatorParameterName:
|
149
|
+
Enabled: false
|
150
|
+
|
137
151
|
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
138
152
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
139
153
|
Naming/FileName:
|
@@ -148,11 +162,34 @@ Naming/FileName:
|
|
148
162
|
# for those heredocs which represent "file" text.
|
149
163
|
#
|
150
164
|
# Configuration parameters: Blacklist.
|
151
|
-
# Blacklist:
|
165
|
+
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
|
152
166
|
Naming/HeredocDelimiterNaming:
|
167
|
+
Details: |
|
168
|
+
|
169
|
+
Use meaningful delimiter names to provide context to the text. The only
|
170
|
+
allowed `EO*` variant if `EOF` which has specific meaning for file content.
|
153
171
|
Blacklist:
|
154
172
|
- !ruby/regexp '/(^|\s)(EO[A-EG-Z]{1}|END)(\s|$)/'
|
155
173
|
|
174
|
+
# It is generally a good idea to match the instance variable names with their
|
175
|
+
# methods to keep consistent with the attribute reader / writer pattern.
|
176
|
+
# However, this can pose an issue in Rails. Most notably, when writing modules
|
177
|
+
# that will be used as controller plugins. The reason is that the Rails
|
178
|
+
# controllers-to-view interface is ivars. Using a leading underscore can help
|
179
|
+
# avoid accidental controller ivar naming conflicts.
|
180
|
+
#
|
181
|
+
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
182
|
+
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
183
|
+
Naming/MemoizedInstanceVariableName:
|
184
|
+
Details: |
|
185
|
+
|
186
|
+
It is generally a good idea to match the instance variable names with their
|
187
|
+
methods to keep consistent with the attribute reader / writer pattern. An
|
188
|
+
exception can be made for modules that want to avoid naming conflicts with
|
189
|
+
classes that include them. In this case a single leading underscore is
|
190
|
+
acceptable.
|
191
|
+
EnforcedStyleForLeadingUnderscores: optional
|
192
|
+
|
156
193
|
# `alias` behavior changes on scope. In general we expect the behavior to be
|
157
194
|
# that which is defined by `alias_method`.
|
158
195
|
#
|
@@ -161,6 +198,13 @@ Naming/HeredocDelimiterNaming:
|
|
161
198
|
# Configuration parameters: EnforcedStyle.
|
162
199
|
# SupportedStyles: prefer_alias, prefer_alias_method
|
163
200
|
Style/Alias:
|
201
|
+
Details: |
|
202
|
+
|
203
|
+
Prefer `alias_method` because `alias` behavior changes based on scope.
|
204
|
+
|
205
|
+
See:
|
206
|
+
- https://stackoverflow.com/questions/4763121/should-i-use-alias-or-alias-method
|
207
|
+
- https://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html
|
164
208
|
EnforcedStyle: prefer_alias_method
|
165
209
|
|
166
210
|
# Keeping with our semantic style we allow use of `and` / `or` conditionals
|
@@ -175,6 +219,12 @@ Style/Alias:
|
|
175
219
|
# Configuration parameters: EnforcedStyle.
|
176
220
|
# SupportedStyles: always, conditionals
|
177
221
|
Style/AndOr:
|
222
|
+
Details: |
|
223
|
+
|
224
|
+
Use `&&` / `||` for conditionals or general comparison. Use `and` / `or`
|
225
|
+
for control flow to provide additional semantic hints:
|
226
|
+
|
227
|
+
system("some command") or system("another command")
|
178
228
|
EnforcedStyle: conditionals
|
179
229
|
|
180
230
|
# These days most people have editors which support unicode and other
|
@@ -191,11 +241,11 @@ Style/AsciiComments:
|
|
191
241
|
# When the return value of the method receiving the block is important prefer
|
192
242
|
# `{..}` over `do..end`.
|
193
243
|
#
|
194
|
-
# Configuration parameters: EnforcedStyle,
|
195
|
-
# FunctionalMethods, IgnoredMethods.
|
244
|
+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
|
196
245
|
# SupportedStyles: line_count_based, semantic, braces_for_chaining
|
197
246
|
Style/BlockDelimiters:
|
198
247
|
Details: |
|
248
|
+
|
199
249
|
Use semantic style for blocks:
|
200
250
|
- Prefer `do...end` over `{...}` for procedural blocks.
|
201
251
|
- Prefer `{...}` over `do...end` for functional blocks.
|
@@ -212,6 +262,10 @@ Style/BlockDelimiters:
|
|
212
262
|
- realtime
|
213
263
|
- with_object
|
214
264
|
FunctionalMethods:
|
265
|
+
- create
|
266
|
+
- create!
|
267
|
+
- build
|
268
|
+
- build!
|
215
269
|
- each_with_object
|
216
270
|
- find
|
217
271
|
- git_source
|
@@ -303,6 +357,7 @@ Style/EmptyMethod:
|
|
303
357
|
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
304
358
|
Style/HashSyntax:
|
305
359
|
Details: |
|
360
|
+
|
306
361
|
Prefer symbol keys using the 1.9 hash syntax. However, when keys are mixed
|
307
362
|
use a consistent mapping style; which generally means using hash rockets.
|
308
363
|
EnforcedStyle: ruby19_no_mixed_keys
|
@@ -316,6 +371,7 @@ Style/HashSyntax:
|
|
316
371
|
# SupportedStyles: line_count_dependent, lambda, literal
|
317
372
|
Style/Lambda:
|
318
373
|
Details: |
|
374
|
+
|
319
375
|
As part of our semantic style we generally use the literal `-> { }` format
|
320
376
|
to indicate this is a function with a return value we care about. As this
|
321
377
|
cop doesn't have a more flexible setting we prefer the literal syntax to
|
@@ -335,7 +391,7 @@ Style/MethodCalledOnDoEndBlock:
|
|
335
391
|
Style/MultilineBlockChain:
|
336
392
|
Enabled: false
|
337
393
|
|
338
|
-
# Context for this cop is too dependent. Often using the numeric
|
394
|
+
# Context for this cop is too dependent. Often using the numeric comparison is
|
339
395
|
# faster. An in certain contexts, Also, depending on the context a numeric
|
340
396
|
# comparison is more consistent and can even be more natural:
|
341
397
|
#
|
@@ -350,6 +406,32 @@ Style/MultilineBlockChain:
|
|
350
406
|
Style/NumericPredicate:
|
351
407
|
Enabled: false
|
352
408
|
|
409
|
+
# In Ruby every method returns a value. Implicitly this is the value of the
|
410
|
+
# last line of the method. This means using `return` is often redundant.
|
411
|
+
# However, there isn't anything inherently wrong about doing so. In fact, in
|
412
|
+
# some cases it can help with a consistent style in a method:
|
413
|
+
#
|
414
|
+
# def transform(value)
|
415
|
+
# return value.call if value.is_a?(Proc)
|
416
|
+
# return value if value.frozen?
|
417
|
+
# return value.dup
|
418
|
+
# end
|
419
|
+
#
|
420
|
+
# Other times it can add context to a seemingly oddly place value:
|
421
|
+
#
|
422
|
+
# def munge(data)
|
423
|
+
# data.slice! 5
|
424
|
+
# return nil
|
425
|
+
# end
|
426
|
+
#
|
427
|
+
# We often omit the explicit `return` in our code. Though sometimes we include
|
428
|
+
# it for improved contextual clues and we don't want Rubocop to complain for
|
429
|
+
# those cases.
|
430
|
+
#
|
431
|
+
# Configuration parameters: AllowMultipleReturnValues.
|
432
|
+
Style/RedundantReturn:
|
433
|
+
Enabled: false
|
434
|
+
|
353
435
|
# Prefer slashes for simple expressions. For multi-line use percent literal
|
354
436
|
# to support comments and other advanced features. By using the mixed style we
|
355
437
|
# are choosing to use `%r{}` for multi-line regexps. In general we are not a
|
@@ -366,6 +448,13 @@ Style/NumericPredicate:
|
|
366
448
|
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
367
449
|
# SupportedStyles: slashes, percent_r, mixed
|
368
450
|
Style/RegexpLiteral:
|
451
|
+
Details: |
|
452
|
+
|
453
|
+
Prefer slashes for simple expressions. Use `%r` for expressions containing
|
454
|
+
slashes and for complex expressions so then can be written across multiple
|
455
|
+
lines (allowing advanced features such as comments). Use of `%r` for
|
456
|
+
expressions spanning multiple lines provides some comprehension parity with
|
457
|
+
general code blocks.
|
369
458
|
EnforcedStyle: mixed
|
370
459
|
|
371
460
|
# If you only need to rescue a single, or predefined set of exceptions, then
|
@@ -407,13 +496,28 @@ Style/RegexpLiteral:
|
|
407
496
|
# Configuration parameters: EnforcedStyle.
|
408
497
|
# SupportedStyles: implicit, explicit
|
409
498
|
Style/RescueStandardError:
|
499
|
+
Details: |
|
500
|
+
|
501
|
+
If you only need to rescue a single, or predefined set of exceptions, then
|
502
|
+
catch each exception explicitly. When you need to include a general error
|
503
|
+
handler or "catch-all" use the "unspecified rescue":
|
504
|
+
|
505
|
+
begin
|
506
|
+
# do something that may cause a standard error
|
507
|
+
rescue TypeError
|
508
|
+
handle_type_error
|
509
|
+
rescue => e
|
510
|
+
handle_error e
|
511
|
+
end
|
512
|
+
|
513
|
+
Avoid rescuing `Exception` as this may hide system errors.
|
410
514
|
EnforcedStyle: implicit
|
411
515
|
|
412
516
|
# We generally prefer double quotes but many generators use single quotes. We
|
413
517
|
# don't view the performance difference to be all that much so we don't care
|
414
518
|
# if the style is mixed or double quotes are used for static strings.
|
415
519
|
#
|
416
|
-
# Configuration parameters: EnforcedStyle,
|
520
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
417
521
|
# SupportedStyles: single_quotes, double_quotes
|
418
522
|
Style/StringLiterals:
|
419
523
|
Enabled: false
|
@@ -440,7 +544,7 @@ Style/SymbolArray:
|
|
440
544
|
MinSize: 3
|
441
545
|
|
442
546
|
# When ternaries become complex they can be difficult to read due to increased
|
443
|
-
#
|
547
|
+
# cognitive load parsing the expression. Cognitive load can increase further
|
444
548
|
# when assignment is involved.
|
445
549
|
#
|
446
550
|
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
|
@@ -448,9 +552,10 @@ Style/SymbolArray:
|
|
448
552
|
Style/TernaryParentheses:
|
449
553
|
AllowSafeAssignment: false
|
450
554
|
Details: |
|
555
|
+
|
451
556
|
When ternaries become complex they can be difficult to read due to
|
452
|
-
increased
|
453
|
-
increase further when assignment is involved. To help reduce this
|
557
|
+
increased cognitive load parsing the expression. Cognitive load can
|
558
|
+
increase further when assignment is involved. To help reduce this cognitive
|
454
559
|
use parentheses for complex expressions.
|
455
560
|
EnforcedStyle: require_parentheses_when_complex
|
456
561
|
|
@@ -466,6 +571,7 @@ Style/TernaryParentheses:
|
|
466
571
|
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
467
572
|
Style/TrailingCommaInArguments:
|
468
573
|
Details: |
|
574
|
+
|
469
575
|
Always use trailing commas for multiline arguments. This makes git diffs
|
470
576
|
easier to read by cutting down on noise when commas are appended. It also
|
471
577
|
simplifies adding, removing, and swapping argument orders.
|
@@ -480,6 +586,7 @@ Style/TrailingCommaInArguments:
|
|
480
586
|
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
481
587
|
Style/TrailingCommaInArrayLiteral:
|
482
588
|
Details: |
|
589
|
+
|
483
590
|
Always use trailing commas for multiline arrays. This makes git diffs
|
484
591
|
easier to read by cutting down on noise when commas are appended. It also
|
485
592
|
simplifies adding, removing, and re-arranging the elements.
|
@@ -492,6 +599,7 @@ Style/TrailingCommaInArrayLiteral:
|
|
492
599
|
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
493
600
|
Style/TrailingCommaInHashLiteral:
|
494
601
|
Details: |
|
602
|
+
|
495
603
|
Always use trailing commas for multiline hashes. This makes git diffs
|
496
604
|
easier to read by cutting down on noise when commas are appended. It also
|
497
605
|
simplifies adding, removing, and re-arranging the elements.
|
data/common_rubocop_rails.yml
CHANGED
@@ -27,6 +27,7 @@ Documentation:
|
|
27
27
|
|
28
28
|
Metrics/BlockLength:
|
29
29
|
Exclude:
|
30
|
+
- 'config/routes.rb'
|
30
31
|
- 'spec/rails_helper.rb'
|
31
32
|
|
32
33
|
# Rails foreign keys and indexes can get long. We want to ignore our annotation
|
@@ -39,6 +40,52 @@ Metrics/LineLength:
|
|
39
40
|
- '\A# fk_rails_'
|
40
41
|
- '\A# index_'
|
41
42
|
|
43
|
+
# For our Rails apps several of them use the `respond_to` with `format` blocks
|
44
|
+
# to handle various mime types (mostly HTML and JSON). Given our `do` / `end`
|
45
|
+
# block style for non-functional blocks (which includes both `respond_to` and
|
46
|
+
# `format`) the general method limit of is too small. This also applies to the
|
47
|
+
# helper methods which define the allowed parameters for the action; especially
|
48
|
+
# for larger forms.
|
49
|
+
#
|
50
|
+
# Here is an example of a minimal controller `update` method which uses the
|
51
|
+
# `respond_to` style to support just the HTML and JSON formats:
|
52
|
+
#
|
53
|
+
# ```ruby
|
54
|
+
# def update
|
55
|
+
# respond_to do |format|
|
56
|
+
# if @resource.update(resource_params)
|
57
|
+
# format.html do
|
58
|
+
# redirect_to resources_url, notice: 'Resource was successfully updated.'
|
59
|
+
# end
|
60
|
+
# format.json do
|
61
|
+
# render :show, status: :ok, location: @resource
|
62
|
+
# end
|
63
|
+
# else
|
64
|
+
# format.html do
|
65
|
+
# render :edit
|
66
|
+
# end
|
67
|
+
# format.json do
|
68
|
+
# render json: @resource.errors, status: :unprocessable_entity
|
69
|
+
# end
|
70
|
+
# end
|
71
|
+
# end
|
72
|
+
# end
|
73
|
+
# ```
|
74
|
+
#
|
75
|
+
# We do believe that the default size of 10, which is what we explicitly
|
76
|
+
# configure below so there's no confusion, is a good general limit to help
|
77
|
+
# encourage a balance between terseness and procedural code. Thus we do not
|
78
|
+
# want to raise the limit, instead we just want to exclude these controllers.
|
79
|
+
#
|
80
|
+
# At this time there is no way for us to exclude just the common controller
|
81
|
+
# actions / *_params methods so we exclude the entire file.
|
82
|
+
#
|
83
|
+
# Configuration parameters: CountComments.
|
84
|
+
Metrics/MethodLength:
|
85
|
+
Max: 10
|
86
|
+
Exclude:
|
87
|
+
- 'app/controllers/**/*_controller.rb'
|
88
|
+
|
42
89
|
# Ignore subclass parent for one off benchmarks
|
43
90
|
#
|
44
91
|
# Benchmarks are generally meant to be small and targeted. They often have
|
@@ -59,11 +106,20 @@ Rails/ApplicationRecord:
|
|
59
106
|
Rails/CreateTableWithTimestamps:
|
60
107
|
Enabled: false
|
61
108
|
|
62
|
-
#
|
109
|
+
# We understand the trade-offs for using the through model versus a lookup
|
110
|
+
# table. As such this cop is just noise as it flags only those cases we really
|
111
|
+
# do want a lookup table.
|
112
|
+
#
|
113
|
+
# Configuration parameters: Include.
|
114
|
+
# Include: app/models/**/*.rb
|
115
|
+
Rails/HasAndBelongsToMany:
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
# The ActiveSupport monkey patches for `present?` are nearly all defined as:
|
63
119
|
#
|
64
120
|
# !blank?
|
65
121
|
#
|
66
|
-
# For most of
|
122
|
+
# For most of us `unless blank?` reads just as easily as `if present?`.
|
67
123
|
# Sometimes contextually, it can read better depending on the branch logic and
|
68
124
|
# surrounding context. As `if present?` requires an additional negation and
|
69
125
|
# method call it is technically slower. In the general case the perf different
|
@@ -79,7 +135,7 @@ Rails/Present:
|
|
79
135
|
# We prefer you use the attribute readers and writes. For those special cases
|
80
136
|
# where the intent is really to interact with the raw underlying attribute we
|
81
137
|
# prefer `read_attribute` and `write_attribute`; as this makes the intent
|
82
|
-
#
|
138
|
+
# explicit. Ideally we'd never use the hash like accessor `[:attr]`.
|
83
139
|
#
|
84
140
|
# We disable this cop because it is not configurable.
|
85
141
|
#
|
data/lib/radius/spec/rails.rb
CHANGED
@@ -40,7 +40,7 @@ RSpec.configure do |config|
|
|
40
40
|
# - http://guides.rubyonrails.org/v5.1.4/testing.html#implementing-a-system-test
|
41
41
|
# - https://relishapp.com/rspec/rspec-core/v/3-7/docs/filtering/exclusion-filters
|
42
42
|
# - http://rspec.info/documentation/3.7/rspec-core/RSpec/Core/Configuration.html#filter_run_excluding-instance_method
|
43
|
-
config.filter_run_excluding type: "system"
|
43
|
+
config.filter_run_excluding type: "system" unless config.files_to_run.one?
|
44
44
|
|
45
45
|
# Always clear the cache before specs to avoid state leak problems
|
46
46
|
config.before do
|
data/lib/radius/spec/version.rb
CHANGED
data/radius-spec.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.required_ruby_version = ">= 2.5"
|
32
32
|
|
33
33
|
spec.add_runtime_dependency "rspec", "~> 3.7"
|
34
|
-
spec.add_runtime_dependency "rubocop", "~> 0.
|
34
|
+
spec.add_runtime_dependency "rubocop", "~> 0.58.1"
|
35
35
|
|
36
36
|
spec.add_development_dependency "bundler", "~> 1.16"
|
37
37
|
spec.add_development_dependency "rake", "~> 12.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radius-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Radius Networks
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.58.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.58.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: bundler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,8 +124,8 @@ licenses:
|
|
124
124
|
- Apache-2.0
|
125
125
|
metadata:
|
126
126
|
bug_tracker_uri: https://github.com/RadiusNetworks/radius-spec/issues
|
127
|
-
changelog_uri: https://github.com/RadiusNetworks/radius-spec/blob/v0.
|
128
|
-
source_code_uri: https://github.com/RadiusNetworks/radius-spec/tree/v0.
|
127
|
+
changelog_uri: https://github.com/RadiusNetworks/radius-spec/blob/v0.4.0/CHANGELOG.md
|
128
|
+
source_code_uri: https://github.com/RadiusNetworks/radius-spec/tree/v0.4.0
|
129
129
|
post_install_message:
|
130
130
|
rdoc_options: []
|
131
131
|
require_paths:
|