makandra-rubocop 5.4.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +73 -0
- data/Gemfile.lock +36 -33
- data/README.md +28 -13
- data/config/default.yml +1082 -144
- data/config/ext/rails.yml +331 -15
- data/config/ext/rspec.yml +169 -27
- data/lib/makandra_rubocop/support/rubocop_spec.rb +4 -4
- data/lib/makandra_rubocop/version.rb +1 -1
- data/makandra-rubocop.gemspec +4 -4
- metadata +10 -10
data/config/ext/rspec.yml
CHANGED
@@ -5,16 +5,88 @@ inherit_mode:
|
|
5
5
|
merge:
|
6
6
|
- Exclude
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
RSpec:
|
9
|
+
Enabled: true
|
10
|
+
Include:
|
11
|
+
- "**/*_spec.rb"
|
12
|
+
- "**/spec/**/*"
|
13
|
+
Language:
|
14
|
+
ExampleGroups:
|
15
|
+
Regular:
|
16
|
+
- describe
|
17
|
+
- context
|
18
|
+
- feature
|
19
|
+
- example_group
|
20
|
+
Skipped:
|
21
|
+
- xdescribe
|
22
|
+
- xcontext
|
23
|
+
- xfeature
|
24
|
+
Focused:
|
25
|
+
- fdescribe
|
26
|
+
- fcontext
|
27
|
+
- ffeature
|
28
|
+
Examples:
|
29
|
+
Regular:
|
30
|
+
- it
|
31
|
+
- specify
|
32
|
+
- example
|
33
|
+
- scenario
|
34
|
+
- its
|
35
|
+
Focused:
|
36
|
+
- fit
|
37
|
+
- fspecify
|
38
|
+
- fexample
|
39
|
+
- fscenario
|
40
|
+
- focus
|
41
|
+
Skipped:
|
42
|
+
- xit
|
43
|
+
- xspecify
|
44
|
+
- xexample
|
45
|
+
- xscenario
|
46
|
+
- skip
|
47
|
+
Pending:
|
48
|
+
- pending
|
49
|
+
Expectations:
|
50
|
+
- expect
|
51
|
+
- is_expected
|
52
|
+
- expect_any_instance_of
|
53
|
+
Helpers:
|
54
|
+
- let
|
55
|
+
- let!
|
56
|
+
Hooks:
|
57
|
+
- prepend_before
|
58
|
+
- before
|
59
|
+
- append_before
|
60
|
+
- around
|
61
|
+
- prepend_after
|
62
|
+
- after
|
63
|
+
- append_after
|
64
|
+
HookScopes:
|
65
|
+
- each
|
66
|
+
- example
|
67
|
+
- context
|
68
|
+
- all
|
69
|
+
- suite
|
70
|
+
Includes:
|
71
|
+
Examples:
|
72
|
+
- it_behaves_like
|
73
|
+
- it_should_behave_like
|
74
|
+
- include_examples
|
75
|
+
Context:
|
76
|
+
- include_context
|
77
|
+
Runners:
|
78
|
+
- to
|
79
|
+
- to_not
|
80
|
+
- not_to
|
81
|
+
SharedGroups:
|
82
|
+
Examples:
|
83
|
+
- shared_examples
|
84
|
+
- shared_examples_for
|
85
|
+
Context:
|
86
|
+
- shared_context
|
87
|
+
Subjects:
|
88
|
+
- subject
|
89
|
+
- subject!
|
18
90
|
|
19
91
|
RSpec/AlignLeftLetBrace:
|
20
92
|
Description: Checks that left braces for adjacent single line lets are aligned.
|
@@ -80,9 +152,25 @@ RSpec/ContextWording:
|
|
80
152
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
|
81
153
|
|
82
154
|
RSpec/DescribeClass:
|
83
|
-
Description: Check that the first argument to the top
|
155
|
+
Description: Check that the first argument to the top-level describe is a constant.
|
84
156
|
Enabled: false # It is nice to follow this approach but we do not want to enforce it
|
157
|
+
IgnoredMetadata:
|
158
|
+
type:
|
159
|
+
- channel
|
160
|
+
- controller
|
161
|
+
- helper
|
162
|
+
- job
|
163
|
+
- mailer
|
164
|
+
- model
|
165
|
+
- request
|
166
|
+
- routing
|
167
|
+
- view
|
168
|
+
- feature
|
169
|
+
- system
|
170
|
+
- mailbox
|
171
|
+
- aruba
|
85
172
|
VersionAdded: '1.0'
|
173
|
+
VersionChanged: '1.44'
|
86
174
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
|
87
175
|
|
88
176
|
RSpec/DescribeMethod:
|
@@ -126,8 +214,8 @@ RSpec/Dialect:
|
|
126
214
|
RSpec/EmptyExampleGroup:
|
127
215
|
Description: Checks if an example group does not include any tests.
|
128
216
|
Enabled: true
|
129
|
-
CustomIncludeMethods: []
|
130
217
|
VersionAdded: '1.7'
|
218
|
+
VersionChanged: '2.0'
|
131
219
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
|
132
220
|
|
133
221
|
RSpec/EmptyHook:
|
@@ -171,7 +259,9 @@ RSpec/ExampleLength:
|
|
171
259
|
Description: Checks for long examples.
|
172
260
|
Enabled: false # We do not want to have such limitation
|
173
261
|
Max: 5
|
262
|
+
CountAsOne: []
|
174
263
|
VersionAdded: '1.5'
|
264
|
+
VersionChanged: '2.3'
|
175
265
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
|
176
266
|
|
177
267
|
RSpec/ExampleWithoutDescription:
|
@@ -231,6 +321,9 @@ RSpec/ExpectOutput:
|
|
231
321
|
RSpec/FilePath:
|
232
322
|
Description: Checks that spec file paths are consistent and well-formed.
|
233
323
|
Enabled: true
|
324
|
+
Include:
|
325
|
+
- "**/*_spec*rb*"
|
326
|
+
- "**/spec/**/*"
|
234
327
|
CustomTransform:
|
235
328
|
RuboCop: rubocop
|
236
329
|
RSpec: rspec
|
@@ -244,6 +337,7 @@ RSpec/Focus:
|
|
244
337
|
Description: Checks if examples are focused.
|
245
338
|
Enabled: true
|
246
339
|
VersionAdded: '1.5'
|
340
|
+
VersionChanged: '2.1'
|
247
341
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
|
248
342
|
|
249
343
|
RSpec/HookArgument:
|
@@ -263,6 +357,12 @@ RSpec/HooksBeforeExamples:
|
|
263
357
|
VersionAdded: '1.29'
|
264
358
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
|
265
359
|
|
360
|
+
RSpec/IdenticalEqualityAssertion:
|
361
|
+
Description: Checks for equality assertions with identical expressions on both sides.
|
362
|
+
Enabled: true
|
363
|
+
VersionAdded: '2.4'
|
364
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
|
365
|
+
|
266
366
|
RSpec/ImplicitBlockExpectation:
|
267
367
|
Description: Check that implicit block expectation syntax is not used.
|
268
368
|
Enabled: true
|
@@ -305,12 +405,6 @@ RSpec/InstanceVariable:
|
|
305
405
|
VersionChanged: '1.7'
|
306
406
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
|
307
407
|
|
308
|
-
RSpec/InvalidPredicateMatcher:
|
309
|
-
Description: Checks invalid usage for predicate matcher.
|
310
|
-
Enabled: true
|
311
|
-
VersionAdded: '1.16'
|
312
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InvalidPredicateMatcher
|
313
|
-
|
314
408
|
RSpec/ItBehavesLike:
|
315
409
|
Description: Checks that only one `it_behaves_like` style is used.
|
316
410
|
Enabled: true
|
@@ -387,7 +481,7 @@ RSpec/MissingExampleGroupArgument:
|
|
387
481
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
388
482
|
|
389
483
|
RSpec/MultipleDescribes:
|
390
|
-
Description: Checks for multiple top
|
484
|
+
Description: Checks for multiple top-level example groups.
|
391
485
|
Enabled: true
|
392
486
|
VersionAdded: '1.0'
|
393
487
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
|
@@ -400,6 +494,14 @@ RSpec/MultipleExpectations:
|
|
400
494
|
VersionChanged: '1.21'
|
401
495
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
|
402
496
|
|
497
|
+
RSpec/MultipleMemoizedHelpers:
|
498
|
+
Description: Checks if example groups contain too many `let` and `subject` calls.
|
499
|
+
Enabled: false # We try to reduce the number of lets if possible, but no need to enforce it
|
500
|
+
AllowSubject: true
|
501
|
+
Max: 5
|
502
|
+
VersionAdded: '1.43'
|
503
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
|
504
|
+
|
403
505
|
RSpec/MultipleSubjects:
|
404
506
|
Description: Checks if an example group defines `subject` multiple times.
|
405
507
|
Enabled: true
|
@@ -492,6 +594,12 @@ RSpec/RepeatedExampleGroupDescription:
|
|
492
594
|
VersionAdded: '1.38'
|
493
595
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription
|
494
596
|
|
597
|
+
RSpec/RepeatedIncludeExample:
|
598
|
+
Description: Check for repeated include of shared examples.
|
599
|
+
Enabled: true
|
600
|
+
VersionAdded: '1.44'
|
601
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedIncludeExample
|
602
|
+
|
495
603
|
RSpec/ReturnFromStub:
|
496
604
|
Description: Checks for consistent style of stub's return setting.
|
497
605
|
Enabled: true
|
@@ -535,6 +643,12 @@ RSpec/SingleArgumentMessageChain:
|
|
535
643
|
VersionChanged: '1.10'
|
536
644
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
|
537
645
|
|
646
|
+
RSpec/StubbedMock:
|
647
|
+
Description: Checks that message expectations do not have a configured response.
|
648
|
+
Enabled: false # Maybe add later, currently there are too many conflicts
|
649
|
+
VersionAdded: '1.44'
|
650
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/StubbedMock
|
651
|
+
|
538
652
|
RSpec/SubjectStub:
|
539
653
|
Description: Checks for stubbed test subjects.
|
540
654
|
Enabled: false #https://github.com/makandra/makandra-rubocop/issues/24
|
@@ -564,7 +678,9 @@ RSpec/VariableName:
|
|
564
678
|
SupportedStyles:
|
565
679
|
- snake_case
|
566
680
|
- camelCase
|
681
|
+
IgnoredPatterns: []
|
567
682
|
VersionAdded: '1.40'
|
683
|
+
VersionChanged: '1.43'
|
568
684
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName
|
569
685
|
|
570
686
|
RSpec/VerifiedDoubles:
|
@@ -588,49 +704,74 @@ RSpec/Yield:
|
|
588
704
|
VersionAdded: '1.32'
|
589
705
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
590
706
|
|
591
|
-
Capybara/CurrentPathExpectation:
|
707
|
+
RSpec/Capybara/CurrentPathExpectation:
|
592
708
|
Description: Checks that no expectations are set on Capybara's `current_path`.
|
593
709
|
Enabled: true
|
594
710
|
VersionAdded: '1.18'
|
711
|
+
VersionChanged: '2.0'
|
595
712
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation
|
596
713
|
|
597
|
-
Capybara/FeatureMethods:
|
714
|
+
RSpec/Capybara/FeatureMethods:
|
598
715
|
Description: Checks for consistent method usage in feature specs.
|
599
716
|
Enabled: true
|
600
717
|
EnabledMethods: []
|
601
718
|
VersionAdded: '1.17'
|
602
|
-
VersionChanged: '
|
719
|
+
VersionChanged: '2.0'
|
603
720
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
|
604
721
|
|
605
|
-
Capybara/VisibilityMatcher:
|
722
|
+
RSpec/Capybara/VisibilityMatcher:
|
606
723
|
Description: Checks for boolean visibility in capybara finders.
|
607
724
|
Enabled: true
|
608
725
|
VersionAdded: '1.39'
|
726
|
+
VersionChanged: '2.0'
|
609
727
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher
|
610
728
|
|
611
|
-
FactoryBot/AttributeDefinedStatically:
|
729
|
+
RSpec/FactoryBot/AttributeDefinedStatically:
|
612
730
|
Description: Always declare attribute values as blocks.
|
613
731
|
Enabled: true
|
732
|
+
Include:
|
733
|
+
- spec/factories.rb
|
734
|
+
- spec/factories/**/*.rb
|
735
|
+
- features/support/factories/**/*.rb
|
614
736
|
VersionAdded: '1.28'
|
737
|
+
VersionChanged: '2.0'
|
615
738
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
|
616
739
|
|
617
|
-
FactoryBot/CreateList:
|
740
|
+
RSpec/FactoryBot/CreateList:
|
618
741
|
Description: Checks for create_list usage.
|
619
742
|
Enabled: true
|
743
|
+
Include:
|
744
|
+
- "**/*_spec.rb"
|
745
|
+
- "**/spec/**/*"
|
746
|
+
- spec/factories.rb
|
747
|
+
- spec/factories/**/*.rb
|
748
|
+
- features/support/factories/**/*.rb
|
620
749
|
EnforcedStyle: create_list
|
621
750
|
SupportedStyles:
|
622
751
|
- create_list
|
623
752
|
- n_times
|
624
753
|
VersionAdded: '1.25'
|
754
|
+
VersionChanged: '2.0'
|
625
755
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
|
626
756
|
|
627
|
-
FactoryBot/FactoryClassName:
|
757
|
+
RSpec/FactoryBot/FactoryClassName:
|
628
758
|
Description: Use string value when setting the class attribute explicitly.
|
629
759
|
Enabled: true
|
760
|
+
Include:
|
761
|
+
- spec/factories.rb
|
762
|
+
- spec/factories/**/*.rb
|
763
|
+
- features/support/factories/**/*.rb
|
630
764
|
VersionAdded: '1.37'
|
765
|
+
VersionChanged: '2.0'
|
631
766
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
|
632
767
|
|
633
|
-
Rails/
|
768
|
+
RSpec/Rails/AvoidSetupHook:
|
769
|
+
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
|
770
|
+
Enabled: true
|
771
|
+
VersionAdded: '2.4'
|
772
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
|
773
|
+
|
774
|
+
RSpec/Rails/HttpStatus:
|
634
775
|
Description: Enforces use of symbolic or numeric value to describe HTTP status.
|
635
776
|
Enabled: false # This should not be enforced
|
636
777
|
EnforcedStyle: symbolic
|
@@ -638,4 +779,5 @@ Rails/HttpStatus:
|
|
638
779
|
- numeric
|
639
780
|
- symbolic
|
640
781
|
VersionAdded: '1.23'
|
782
|
+
VersionChanged: '2.0'
|
641
783
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'open3'
|
2
2
|
|
3
3
|
RSpec.describe 'rubocop' do
|
4
|
-
it '
|
4
|
+
it 'should not be offended' do
|
5
5
|
command = self.class.description
|
6
|
-
stdout, stderr, status = Open3.capture3('bundle', 'exec', command)
|
7
|
-
|
6
|
+
stdout, stderr, status = Open3.capture3('bundle', 'exec', command, '--format', 'simple')
|
7
|
+
failure_message = [stderr, stdout].reject(&:empty?).join("\n\n")
|
8
8
|
|
9
|
-
expect(status.success?).to eq(true),
|
9
|
+
expect(status.success?).to eq(true), failure_message
|
10
10
|
end
|
11
11
|
end
|
data/makandra-rubocop.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'makandra_rubocop/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'makandra-rubocop'
|
7
7
|
spec.version = MakandraRubocop::VERSION
|
8
|
-
spec.required_ruby_version = '>= 2.
|
8
|
+
spec.required_ruby_version = '>= 2.5.0'
|
9
9
|
spec.authors = ['Arne Hartherz', 'Emanuel Denzel']
|
10
10
|
spec.email = ['arne.hartherz@makandra.de', 'emanuel.denzel@makandra.de']
|
11
11
|
|
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.add_dependency 'rubocop', '~>
|
27
|
-
spec.add_dependency 'rubocop-rails', '~> 2.
|
28
|
-
spec.add_dependency 'rubocop-rspec', '~>
|
26
|
+
spec.add_dependency 'rubocop', '~> 1.18.4'
|
27
|
+
spec.add_dependency 'rubocop-rails', '~> 2.11.3'
|
28
|
+
spec.add_dependency 'rubocop-rspec', '~> 2.4.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
31
|
spec.add_development_dependency 'rake', '~> 12.3'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: makandra-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arne Hartherz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,42 +17,42 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.18.4
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 1.18.4
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rubocop-rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.11.3
|
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: 2.
|
41
|
+
version: 2.11.3
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rubocop-rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 2.4.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 2.4.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: bundler
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 2.
|
122
|
+
version: 2.5.0
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.2.25
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: makandra's default Rubocop configuration
|