finstyle 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2516678794acc73b1d672039738734f59e277da8
4
- data.tar.gz: ad965baa09e63ea6fed1d3d8a59331fbb988de84
3
+ metadata.gz: f26c307c9547fce50ff28e05b8d1c71c3cb24720
4
+ data.tar.gz: 434ca3d637bbfab4e6a64065af0e5eba2f14db09
5
5
  SHA512:
6
- metadata.gz: 490b0375853980a72bdc86fb2ea8a8fc719dddc2f387de649332983639f582060b468ce269e0e758a4ef782880442a0a95a11a127359ae450fd47bce30591971
7
- data.tar.gz: 48bcc83bf599e376a4cca64f34bc01ab07a1d0ad8fe5d2164b94e4bfefd15bad10d1de68b6a4a65ff721cf5a29dfe949a3fb80fff3712b21798d096f86c13a35
6
+ metadata.gz: a03ec604d53ce49184384dfc52973809349bb12f5278babfebe4da005376f5ff1f67ed3247f61d390898cc2a059fc50ec2e567076f205ea8142bbd1490409875
7
+ data.tar.gz: 86b2ca4f84365c3503a4b8c336c292a5c0f8120aeebc86c4decf189bd59f76304556fbbb4aa0f4585aa3a395c1993ff4c6d4b8781970dbf21e896ea00bb392b9
@@ -4,7 +4,6 @@ rvm:
4
4
  - 2.1
5
5
  - 2.0.0
6
6
  - 1.9.3
7
- - 1.9.2
8
7
  - ruby-head
9
8
  - jruby-19mode
10
9
 
@@ -1,3 +1,15 @@
1
+ ## 1.2.0 / 2014-08-30
2
+
3
+ ### Breaking changes
4
+
5
+ * Upgrade to RuboCop 0.25.0 support. ([@fnichol][])
6
+ * Drop support for Ruby 1.9.2 as upstream (RuboCop) decided to drop support between 0.24.1 and 0.25.0. ([@fnichol][])
7
+
8
+ ### Improvements
9
+
10
+ * Pull request [#1][]: Readme typo fix. ([@cwjohnston][])
11
+
12
+
1
13
  ## 1.1.0 / 2014-07-22
2
14
 
3
15
  ### New features
@@ -25,4 +37,6 @@
25
37
  The initial release.
26
38
 
27
39
  <!--- The following link definition list is generated by PimpMyChangelog --->
28
- [@fnichol]: https://github.com/fnichol
40
+ [#1]: https://github.com/fnichol/finstyle/issues/1
41
+ [@cwjohnston]: https://github.com/cwjohnston
42
+ [@fnichol]: https://github.com/fnichol
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  gemspec
data/Guardfile CHANGED
@@ -1,4 +1,6 @@
1
- guard :rubocop, keep_failed: true, cli: "-r finstyle" do
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ guard :rubocop, :keep_failed => true, :cli => "-r finstyle" do
2
4
  watch(%r{.+\.rb$})
3
5
  watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
4
6
  end
data/README.md CHANGED
@@ -88,7 +88,7 @@ guard :rubocop, cli: "--config #{Finstyle.config}" do
88
88
  end
89
89
  ```
90
90
 
91
- ### .rubycop.yml
91
+ ### .rubocop.yml
92
92
 
93
93
  As with vanilla RuboCop, any custom settings can still be placed in a `.rubocop.yml` file in the root of your project.
94
94
 
@@ -54,12 +54,16 @@ Style/BeginBlock:
54
54
  Description: 'Avoid the use of BEGIN blocks.'
55
55
  Enabled: true
56
56
 
57
+ Style/BarePercentLiterals:
58
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
59
+ Enabled: true
60
+
57
61
  Style/BlockComments:
58
62
  Description: 'Do not use block comments.'
59
63
  Enabled: true
60
64
 
61
- Style/BlockNesting:
62
- Description: 'Avoid excessive block nesting'
65
+ Style/BlockEndNewline:
66
+ Description: 'Put end statement of multiline block on its own line.'
63
67
  Enabled: true
64
68
 
65
69
  Style/Blocks:
@@ -97,10 +101,6 @@ Style/ClassCheck:
97
101
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
98
102
  Enabled: true
99
103
 
100
- Style/ClassLength:
101
- Description: 'Avoid classes longer than 100 lines of code.'
102
- Enabled: true
103
-
104
104
  Style/ClassMethods:
105
105
  Description: 'Use self when defining module/class methods.'
106
106
  Enabled: true
@@ -131,10 +131,6 @@ Style/ConstantName:
131
131
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
132
132
  Enabled: true
133
133
 
134
- Style/CyclomaticComplexity:
135
- Description: 'Avoid complex methods.'
136
- Enabled: true
137
-
138
134
  Style/DefWithParentheses:
139
135
  Description: 'Use def with parentheses when there are arguments.'
140
136
  Enabled: true
@@ -271,10 +267,6 @@ Style/LineEndConcatenation:
271
267
  line end.
272
268
  Enabled: true
273
269
 
274
- Style/LineLength:
275
- Description: 'Limit lines to 80 characters.'
276
- Enabled: true
277
-
278
270
  Style/MethodCallParentheses:
279
271
  Description: 'Do not use parentheses for method calls with no arguments.'
280
272
  Enabled: true
@@ -285,10 +277,6 @@ Style/MethodDefParentheses:
285
277
  parentheses.
286
278
  Enabled: true
287
279
 
288
- Style/MethodLength:
289
- Description: 'Avoid methods longer than 10 lines of code.'
290
- Enabled: true
291
-
292
280
  Style/MethodName:
293
281
  Description: 'Use the configured style when naming methods.'
294
282
  Enabled: true
@@ -301,6 +289,10 @@ Style/MultilineBlockChain:
301
289
  Description: 'Avoid multi-line chains of blocks.'
302
290
  Enabled: true
303
291
 
292
+ Style/MultilineBlockLayout:
293
+ Description: 'Ensures newlines after multiline block do statements.'
294
+ Enabled: true
295
+
304
296
  Style/MultilineIfThen:
305
297
  Description: 'Never use then for multi-line if/unless.'
306
298
  Enabled: true
@@ -357,10 +349,6 @@ Style/OpMethod:
357
349
  Description: 'When defining binary operators, name the argument other.'
358
350
  Enabled: true
359
351
 
360
- Style/ParameterLists:
361
- Description: 'Avoid parameter lists longer than three or four parameters.'
362
- Enabled: true
363
-
364
352
  Style/ParenthesesAroundCondition:
365
353
  Description: >-
366
354
  Don't use parentheses around the condition of an
@@ -371,6 +359,10 @@ Style/PercentLiteralDelimiters:
371
359
  Description: 'Use `%`-literal delimiters consistently'
372
360
  Enabled: true
373
361
 
362
+ Style/PercentQLiterals:
363
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
364
+ Enabled: true
365
+
374
366
  Style/PerlBackrefs:
375
367
  Description: 'Avoid Perl-style regex back references.'
376
368
  Enabled: true
@@ -416,7 +408,9 @@ Style/RescueModifier:
416
408
  Enabled: true
417
409
 
418
410
  Style/SelfAssignment:
419
- Description: 'Checks for places where self-assignment shorthand should have been used.'
411
+ Description: >-
412
+ Checks for places where self-assignment shorthand should have
413
+ been used.
420
414
  Enabled: true
421
415
 
422
416
  Style/Semicolon:
@@ -595,6 +589,40 @@ Style/WordArray:
595
589
  Description: 'Use %w or %W for arrays of words.'
596
590
  Enabled: true
597
591
 
592
+ #################### Metrics ################################
593
+
594
+ Metrics/BlockNesting:
595
+ Description: 'Avoid excessive block nesting'
596
+ Enabled: true
597
+
598
+ Metrics/ClassLength:
599
+ Description: 'Avoid classes longer than 100 lines of code.'
600
+ Enabled: true
601
+
602
+ Metrics/CyclomaticComplexity:
603
+ Description: >-
604
+ A complexity metric that is strongy correlated to the number
605
+ of test cases needed to validate a method.
606
+ Enabled: true
607
+
608
+ Metrics/LineLength:
609
+ Description: 'Limit lines to 80 characters.'
610
+ Enabled: true
611
+
612
+ Metrics/MethodLength:
613
+ Description: 'Avoid methods longer than 10 lines of code.'
614
+ Enabled: true
615
+
616
+ Metrics/ParameterLists:
617
+ Description: 'Avoid parameter lists longer than three or four parameters.'
618
+ Enabled: true
619
+
620
+ Metrics/PerceivedComplexity:
621
+ Description: >-
622
+ A complexity metric geared towards measuring complexity for a
623
+ human reader.
624
+ Enabled: true
625
+
598
626
  #################### Lint ################################
599
627
  ### Warnings
600
628
 
@@ -619,7 +647,9 @@ Lint/BlockAlignment:
619
647
  Enabled: true
620
648
 
621
649
  Lint/ConditionPosition:
622
- Description: 'Checks for condition placed in a confusing position relative to the keyword.'
650
+ Description: >-
651
+ Checks for condition placed in a confusing position relative to
652
+ the keyword.
623
653
  Enabled: true
624
654
 
625
655
  Lint/Debugger:
@@ -781,7 +811,9 @@ Rails/Output:
781
811
  Enabled: true
782
812
 
783
813
  Rails/ReadWriteAttribute:
784
- Description: 'Checks for read_attribute(:attr) and write_attribute(:attr, val).'
814
+ Description: >-
815
+ Checks for read_attribute(:attr) and
816
+ write_attribute(:attr, val).
785
817
  Enabled: true
786
818
 
787
819
  Rails/ScopeArgs:
@@ -14,6 +14,21 @@ Lint/AssignmentInCondition:
14
14
  Lint/EndAlignment:
15
15
  AlignWith: variable
16
16
 
17
+ #
18
+ ### Metrics Cops
19
+ #
20
+
21
+ # ABC complexity is a far better code smell signal than raw class length.
22
+ Metrics/ClassLength:
23
+ Max: 300
24
+
25
+ Metrics/LineLength:
26
+ Max: 100
27
+
28
+ # ABC complexity is a far better code smell signal than raw method length.
29
+ Metrics/MethodLength:
30
+ Max: 20
31
+
17
32
  #
18
33
  ### Style Cops
19
34
  #
@@ -29,10 +44,6 @@ Style/AlignParameters:
29
44
  Style/Blocks:
30
45
  Enabled: false
31
46
 
32
- # ABC complexity is a far better code smell signal than raw class length.
33
- Style/ClassLength:
34
- Max: 300
35
-
36
47
  # Words help us convey meaning and Ruby aliased methods help with this.
37
48
  Style/CollectionMethods:
38
49
  PreferredMethods:
@@ -71,13 +82,6 @@ Style/GuardClause:
71
82
  Style/IfUnlessModifier:
72
83
  Enabled: false
73
84
 
74
- Style/LineLength:
75
- Max: 100
76
-
77
- # ABC complexity is a far better code smell signal than raw method length.
78
- Style/MethodLength:
79
- Max: 20
80
-
81
85
  # True functional-style chaining is fine by me
82
86
  Style/MultilineBlockChain:
83
87
  Enabled: false
@@ -10,7 +10,16 @@ AllCops:
10
10
  # Include gemspec and Rakefile
11
11
  Include:
12
12
  - '**/*.gemspec'
13
+ - '**/*.podspec'
14
+ - '**/*.jbuilder'
15
+ - '**/*.rake'
16
+ - '**/Gemfile'
13
17
  - '**/Rakefile'
18
+ - '**/Capfile'
19
+ - '**/Guardfile'
20
+ - '**/Podfile'
21
+ - '**/Thorfile'
22
+ - '**/Vagrantfile'
14
23
  Exclude:
15
24
  - 'vendor/**/*'
16
25
  # By default, the rails cops are not run. Override in project or home
@@ -107,8 +116,21 @@ Style/AlignParameters:
107
116
  - with_first_parameter
108
117
  - with_fixed_indentation
109
118
 
110
- Style/BlockNesting:
111
- Max: 3
119
+ Style/AndOr:
120
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
121
+ # or completely (always).
122
+ EnforcedStyle: always
123
+ SupportedStyles:
124
+ - always
125
+ - conditionals
126
+
127
+
128
+ # Checks if usage of %() or %Q() matches configuration.
129
+ Style/BarePercentLiterals:
130
+ EnforcedStyle: bare_percent
131
+ SupportedStyles:
132
+ - percent_q
133
+ - bare_percent
112
134
 
113
135
  Style/BracesAroundHashParameters:
114
136
  EnforcedStyle: no_braces
@@ -150,10 +172,6 @@ Style/ClassCheck:
150
172
  SupportedStyles:
151
173
  - is_a?
152
174
  - kind_of?
153
-
154
- Style/ClassLength:
155
- CountComments: false # count full line comments?
156
- Max: 100
157
175
 
158
176
  # Align with the style guide.
159
177
  Style/CollectionMethods:
@@ -179,10 +197,6 @@ Style/CommentAnnotation:
179
197
  - HACK
180
198
  - REVIEW
181
199
 
182
- # Avoid complex methods.
183
- Style/CyclomaticComplexity:
184
- Max: 6
185
-
186
200
  # Multi-line method chaining should be done with leading dots.
187
201
  Style/DotPosition:
188
202
  EnforcedStyle: leading
@@ -208,6 +222,9 @@ Style/FileName:
208
222
  - '**/Rakefile'
209
223
  - '**/Gemfile'
210
224
  - '**/Capfile'
225
+ - '**/Vagrantfile'
226
+ - '**/Podfile'
227
+ - '**/Thorfile'
211
228
 
212
229
  # Checks use of for or each in multiline loops.
213
230
  Style/For:
@@ -262,15 +279,14 @@ Style/LambdaCall:
262
279
  - call
263
280
  - braces
264
281
 
265
- Style/LineLength:
266
- Max: 80
267
- AllowURI: true
268
-
269
282
  Style/Next:
270
283
  # With `always` all conditions at the end of an iteration needs to be
271
- # replace by next - with `skip_modifier_ifs` the modifier if like this one
284
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
272
285
  # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
273
286
  EnforcedStyle: skip_modifier_ifs
287
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
288
+ # needs to have to trigger this cop
289
+ MinBodyLength: 3
274
290
  SupportedStyles:
275
291
  - skip_modifier_ifs
276
292
  - always
@@ -290,10 +306,6 @@ Style/MethodDefParentheses:
290
306
  - require_parentheses
291
307
  - require_no_parentheses
292
308
 
293
- Style/MethodLength:
294
- CountComments: false # count full line comments?
295
- Max: 10
296
-
297
309
  Style/MethodName:
298
310
  EnforcedStyle: snake_case
299
311
  SupportedStyles:
@@ -303,10 +315,6 @@ Style/MethodName:
303
315
  Style/NumericLiterals:
304
316
  MinDigits: 5
305
317
 
306
- Style/ParameterLists:
307
- Max: 5
308
- CountKeywordArgs: true
309
-
310
318
  # Allow safe assignment in conditions.
311
319
  Style/ParenthesesAroundCondition:
312
320
  AllowSafeAssignment: true
@@ -323,6 +331,12 @@ Style/PercentLiteralDelimiters:
323
331
  '%W': ()
324
332
  '%x': ()
325
333
 
334
+ Style/PercentQLiterals:
335
+ EnforcedStyle: lower_case_q
336
+ SupportedStyles:
337
+ - lower_case_q # Use %q when possible, %Q when necessary
338
+ - upper_case_q # Always use %Q
339
+
326
340
  Style/PredicateName:
327
341
  NamePrefixBlacklist:
328
342
  - is_
@@ -335,7 +349,6 @@ Style/RaiseArgs:
335
349
  - compact # raise Exception.new(msg)
336
350
  - exploded # raise Exception, msg
337
351
 
338
-
339
352
  Style/RedundantReturn:
340
353
  # When true allows code like `return x, y`.
341
354
  AllowMultipleReturnValues: false
@@ -356,7 +369,6 @@ Style/SignalException:
356
369
  - only_fail
357
370
  - semantic
358
371
 
359
-
360
372
  Style/SingleLineBlockParams:
361
373
  Methods:
362
374
  - reduce:
@@ -463,6 +475,34 @@ Style/WhileUntilModifier:
463
475
  Style/WordArray:
464
476
  MinSize: 0
465
477
 
478
+ ##################### Metrics ##################################
479
+
480
+ Metrics/BlockNesting:
481
+ Max: 3
482
+
483
+ Metrics/ClassLength:
484
+ CountComments: false # count full line comments?
485
+ Max: 100
486
+
487
+ # Avoid complex methods.
488
+ Metrics/CyclomaticComplexity:
489
+ Max: 6
490
+
491
+ Metrics/LineLength:
492
+ Max: 80
493
+ AllowURI: true
494
+
495
+ Metrics/MethodLength:
496
+ CountComments: false # count full line comments?
497
+ Max: 10
498
+
499
+ Metrics/ParameterLists:
500
+ Max: 5
501
+ CountKeywordArgs: true
502
+
503
+ Metrics/PerceivedComplexity:
504
+ Max: 7
505
+
466
506
  ##################### Lint ##################################
467
507
 
468
508
  # Allow safe assignment in conditions.
@@ -509,6 +549,13 @@ Rails/HasAndBelongsToMany:
509
549
  Include:
510
550
  - app/models/**/*.rb
511
551
 
552
+ Rails/Output:
553
+ Include:
554
+ - app/**/*.rb
555
+ - config/**/*.rb
556
+ - db/**/*.rb
557
+ - lib/**/*.rb
558
+
512
559
  Rails/ReadWriteAttribute:
513
560
  Include:
514
561
  - app/models/**/*.rb
@@ -19,7 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency("rubocop", "0.24.1")
22
+ spec.required_ruby_version = ">= 1.9.3"
23
+
24
+ spec.add_dependency("rubocop", "0.25.0")
23
25
 
24
26
  spec.add_development_dependency("bundler", "~> 1.6")
25
27
  spec.add_development_dependency("rake", "~> 10.0")
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module Finstyle
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.24.1
19
+ version: 0.25.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.24.1
26
+ version: 0.25.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: 1.9.3
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="