simplycop 1.19.3 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 340380f1fa0cc31faa8be3cce2be00d8cb11aec98a6561df1692574951b6761b
4
- data.tar.gz: 5714996ab72a477ea3bfcdcf8966606ee8e8890ef4fa0d889bdb14ac2e5de6ed
3
+ metadata.gz: 05bff7f3846c7dcd738db0d321c424e490ff3e5ff5ce1d26b0ba3bbeb5ad8164
4
+ data.tar.gz: 872c229795cd379265ac594ec523f7e815f276c50b44f318ca56fd498a7c1d04
5
5
  SHA512:
6
- metadata.gz: 62fe9bdd0071394480397fcf53cd636144f204c4bccf040aba06dffdef736a2d8b109fad225240120872f27a4c1481c07fb0313bdf66fe2d3fe612bbb819e5a6
7
- data.tar.gz: fbe61769aba6efa7bb418401c31092883cad62213651b839a7ab4fc76e17496381f2d01b22d7c6c3eb74028fe586857c409a36c3ba1ce3a9bcd8bc0d5b122854
6
+ metadata.gz: 5459ad328d03406a89c52540fc62be75f196f4eefd6064213355b797727a80024fb0f376b0d0bef5e4311abff0d02e5ce4c4bf5025e5ecbc242df2089ba384d4
7
+ data.tar.gz: e6fef72378871e962d74dd973b0d0883b2218e1703bbfd498497fdb2c5063d19d400745b3dc428bbb704060517cdfbebba69e42fd8e35aefc6ed3b4f63a03b34
data/.rubocop.yml CHANGED
@@ -1,6 +1,13 @@
1
1
  inherit_from:
2
2
  - .simplycop.yml
3
+ - .simplycop_capybara.yml
4
+ - .simplycop_factory_bot.yml
5
+ - .simplycop_performance.yml
6
+ - .simplycop_rails.yml
3
7
  - .simplycop_rspec.yml
8
+ - .simplycop_rspec_rails.yml
4
9
 
5
10
  AllCops:
6
- TargetRubyVersion: 3.1
11
+ TargetRubyVersion: 3.1
12
+ Exclude:
13
+ - simplycop.gemspec
@@ -0,0 +1,35 @@
1
+ require:
2
+ - rubocop-capybara
3
+
4
+ Capybara/ClickLinkOrButtonStyle:
5
+ Enabled: false
6
+
7
+ Capybara/CurrentPathExpectation:
8
+ Enabled: true
9
+
10
+ Capybara/MatchStyle:
11
+ Enabled: true
12
+
13
+ Capybara/NegationMatcher:
14
+ Enabled: true
15
+
16
+ Capybara/RedundantWithinFind:
17
+ Enabled: true
18
+
19
+ Capybara/SpecificActions:
20
+ Enabled: true
21
+
22
+ Capybara/SpecificFinders:
23
+ Enabled: true
24
+
25
+ Capybara/SpecificMatcher:
26
+ Enabled: true
27
+
28
+ Capybara/VisibilityMatcher:
29
+ Enabled: true
30
+
31
+ Capybara/RSpec/HaveSelector:
32
+ Enabled: true
33
+
34
+ Capybara/RSpec/PredicateMatcher:
35
+ Enabled: true
@@ -0,0 +1,36 @@
1
+ require:
2
+ - rubocop-factory_bot
3
+
4
+ FactoryBot/AssociationStyle:
5
+ Enabled: true
6
+
7
+ FactoryBot/AttributeDefinedStatically:
8
+ Enabled: true
9
+
10
+ FactoryBot/ConsistentParenthesesStyle:
11
+ Enabled: true
12
+
13
+ FactoryBot/CreateList:
14
+ Enabled: false
15
+
16
+ FactoryBot/ExcessiveCreateList:
17
+ Enabled: true
18
+
19
+ FactoryBot/FactoryAssociationWithStrategy:
20
+ Enabled: true
21
+
22
+ FactoryBot/FactoryClassName:
23
+ Enabled: true
24
+
25
+ FactoryBot/FactoryNameStyle:
26
+ Enabled: true
27
+
28
+ FactoryBot/IdSequence:
29
+ Enabled: true
30
+
31
+ FactoryBot/RedundantFactoryOption:
32
+ Enabled: true
33
+
34
+ # Prefer explicit factorybot call
35
+ FactoryBot/SyntaxMethods:
36
+ Enabled: false
data/.simplycop_rails.yml CHANGED
@@ -415,3 +415,6 @@ Rails/WhereNot:
415
415
  # Anticipate conflicts with Mongoid, like Rails/WhereNot
416
416
  Rails/WhereNotWithMultipleConditions:
417
417
  Enabled: false
418
+
419
+ Rails/WhereRange:
420
+ Enabled: true
data/.simplycop_rspec.yml CHANGED
@@ -70,7 +70,14 @@ RSpec/DescribedClassModuleWrapping:
70
70
  Enabled: false
71
71
 
72
72
  RSpec/Dialect:
73
- Enabled: false
73
+ Enabled: true
74
+ PreferredMethods:
75
+ background: :before
76
+ scenario: :it
77
+ xscenario: :xit
78
+ given: :let
79
+ given!: :let!
80
+ feature: :describe
74
81
 
75
82
  RSpec/DuplicatedMetadata:
76
83
  Enabled: true
@@ -126,10 +133,10 @@ RSpec/ExpectChange:
126
133
  RSpec/ExpectInHook:
127
134
  Enabled: true
128
135
 
129
- RSpec/ExpectOutput:
130
- Enabled: false
136
+ RSpec/ExpectInLet:
137
+ Enabled: true
131
138
 
132
- RSpec/FilePath:
139
+ RSpec/ExpectOutput:
133
140
  Enabled: false
134
141
 
135
142
  RSpec/Focus:
@@ -200,6 +207,9 @@ RSpec/MetadataStyle:
200
207
  RSpec/MissingExampleGroupArgument:
201
208
  Enabled: true
202
209
 
210
+ RSpec/MissingExpectationTargetMethod:
211
+ Enabled: true
212
+
203
213
  RSpec/MultipleDescribes:
204
214
  Enabled: true
205
215
 
@@ -333,119 +343,3 @@ RSpec/VoidExpect:
333
343
 
334
344
  RSpec/Yield:
335
345
  Enabled: true
336
-
337
- # Rspec/Capybara
338
-
339
- # Similar to FactoryBot (see below) there is an RSpec/Capybara department and a separate Capybara
340
- # package which is not installed in simplycop. This configuration is just for the RSpec department.
341
- # The namespacing has been changed to avoid warnings.
342
-
343
- RSpec/Capybara:
344
- Enabled: true
345
- Include:
346
- - spec/integration/*.rb
347
-
348
- Capybara/CurrentPathExpectation:
349
- Enabled: true
350
-
351
- RSpec/Capybara/FeatureMethods:
352
- Enabled: true
353
-
354
- Capybara/MatchStyle:
355
- Enabled: true
356
-
357
- Capybara/NegationMatcher:
358
- Enabled: true
359
-
360
- Capybara/SpecificActions:
361
- Enabled: true
362
-
363
- Capybara/SpecificFinders:
364
- Enabled: true
365
-
366
- Capybara/SpecificMatcher:
367
- Enabled: true
368
-
369
- Capybara/VisibilityMatcher:
370
- Enabled: true
371
-
372
- # RSpec/FactoryBot
373
- # NB: There is an RSpec/FactoryBot department and a separate FactoryBot package. The FactoryBot package is
374
- # not installed on simplycop. The configuration is just for the RSpec department, namespaced to avoid warnings.
375
-
376
- FactoryBot/AttributeDefinedStatically:
377
- Enabled: true
378
-
379
- FactoryBot/ConsistentParenthesesStyle:
380
- Enabled: true
381
-
382
- FactoryBot/CreateList:
383
- Enabled: false
384
-
385
- FactoryBot/FactoryClassName:
386
- Enabled: true
387
-
388
- FactoryBot/FactoryNameStyle:
389
- Enabled: true
390
-
391
- # Prefer explicit factorybot call
392
- FactoryBot/SyntaxMethods:
393
- Enabled: false
394
-
395
- # Previously some FactoryBot package cops were configured due to the above confusion. There is less crossover between
396
- # RSpec/FactoryBot and FactoryBot than Capybara, so it generated a number of errors when they weren't found.
397
- # This is how they were configured:
398
-
399
- # FactoryBot/AssociationStyle:
400
- # Enabled: true
401
-
402
- # FactoryBot/AttributeDefinedStatically:
403
- # Enabled: true
404
-
405
- # FactoryBot/ConsistentParenthesesStyle:
406
- # Enabled: true
407
-
408
- # FactoryBot/CreateList:
409
- # Enabled: false
410
-
411
- # FactoryBot/FactoryAssociationWithStrategy:
412
- # Enabled: true
413
-
414
- # FactoryBot/FactoryClassName:
415
- # Enabled: true
416
-
417
- # FactoryBot/FactoryNameStyle:
418
- # Enabled: true
419
-
420
- # FactoryBot/IdSequence:
421
- # Enabled: true
422
-
423
- # FactoryBot/RedundantFactoryOption:
424
- # Enabled: true
425
-
426
- # # Prefer explicit factorybot call
427
- # FactoryBot/SyntaxMethods:
428
- # Enabled: false
429
-
430
- # Rspec/Rails
431
-
432
- RSpecRails/AvoidSetupHook: # new in 2.4
433
- Enabled: true
434
-
435
- RSpecRails/HaveHttpStatus:
436
- Enabled: true
437
-
438
- RSpecRails/HttpStatus:
439
- Enabled: true
440
-
441
- RSpecRails/InferredSpecType:
442
- Enabled: true
443
-
444
- RSpecRails/MinitestAssertions:
445
- Enabled: true
446
-
447
- RSpecRails/NegationBeValid:
448
- Enabled: true
449
-
450
- RSpecRails/TravelAround:
451
- Enabled: true
@@ -0,0 +1,23 @@
1
+ require:
2
+ - rubocop-rspec_rails
3
+
4
+ RSpecRails/AvoidSetupHook:
5
+ Enabled: true
6
+
7
+ RSpecRails/HaveHttpStatus:
8
+ Enabled: true
9
+
10
+ RSpecRails/HttpStatus:
11
+ Enabled: true
12
+
13
+ RSpecRails/InferredSpecType:
14
+ Enabled: true
15
+
16
+ RSpecRails/MinitestAssertions:
17
+ Enabled: true
18
+
19
+ RSpecRails/NegationBeValid:
20
+ Enabled: true
21
+
22
+ RSpecRails/TravelAround:
23
+ Enabled: true
data/docs/index.md CHANGED
@@ -56,6 +56,16 @@ inherit_gem:
56
56
  - .simplycop_rspec.yml
57
57
  ```
58
58
 
59
+ You may also want the following packages:
60
+ ```yaml
61
+
62
+ - .simplycop_capybara.yml
63
+ - .simplycop_factory_bot.yml
64
+ - .simplycop_rspec_rails.yml
65
+ ```
66
+
67
+ NB: Capybara, FactoryBot and RSpecRails cops were previously available either via departments within `rubocop_rspec` or as packages in their own right. As of `rubocop_rspec` v3, they no longer exist as departments within `rubocop_rspec` and the packages need installing independently. If you use simplycop v1, you will still have access to some of these cops by inheriting `.simplycop_rspec`. As of simplycop v2 (which uses `rubocop_rspec` v3) you would need to inherit the packages individually.
68
+
59
69
  ## Usage
60
70
 
61
71
  Run Rubocop as you would usually do, i.e.
@@ -19,7 +19,7 @@ module Security
19
19
  end
20
20
 
21
21
  def found_match(string)
22
- string.match(/config.consider_all_requests\S?.*=\s?.*true/) ? true : false
22
+ /config.consider_all_requests\S?.*=\s?.*true/.match?(string)
23
23
  end
24
24
  end
25
25
  end
@@ -7,5 +7,5 @@
7
7
  #
8
8
 
9
9
  module Simplycop
10
- VERSION = '1.19.3'
10
+ VERSION = '2.0.1'
11
11
  end
data/simplycop.gemspec CHANGED
@@ -17,10 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'rubocop', '1.64.0'
21
- spec.add_dependency 'rubocop-performance', '1.21.0'
22
- spec.add_dependency 'rubocop-rails', '2.25.0'
23
- spec.add_dependency 'rubocop-rspec', '2.29.2'
20
+ spec.add_dependency 'rubocop', '1.64.1'
21
+ spec.add_dependency 'rubocop-capybara', '2.21.0'
22
+ spec.add_dependency 'rubocop-factory_bot', '2.26.1'
23
+ spec.add_dependency 'rubocop-performance', '1.21.1'
24
+ spec.add_dependency 'rubocop-rails', '2.25.1'
25
+ spec.add_dependency 'rubocop-rspec', '3.0.2'
26
+ spec.add_dependency 'rubocop-rspec_rails', '2.30.0'
24
27
  spec.add_development_dependency 'bundler', '>= 2.2.15'
25
28
  spec.add_development_dependency 'rake', '>= 12.3.3'
26
29
  spec.add_development_dependency 'rspec', '~> 3.10'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplycop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.3
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-26 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,56 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.64.0
19
+ version: 1.64.1
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: 1.64.0
26
+ version: 1.64.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-capybara
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 2.21.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.21.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-factory_bot
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.26.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.26.1
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: rubocop-performance
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - '='
32
60
  - !ruby/object:Gem::Version
33
- version: 1.21.0
61
+ version: 1.21.1
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - '='
39
67
  - !ruby/object:Gem::Version
40
- version: 1.21.0
68
+ version: 1.21.1
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: rubocop-rails
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
73
  - - '='
46
74
  - !ruby/object:Gem::Version
47
- version: 2.25.0
75
+ version: 2.25.1
48
76
  type: :runtime
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
80
  - - '='
53
81
  - !ruby/object:Gem::Version
54
- version: 2.25.0
82
+ version: 2.25.1
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rubocop-rspec
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - '='
60
88
  - !ruby/object:Gem::Version
61
- version: 2.29.2
89
+ version: 3.0.2
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 3.0.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rspec_rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 2.30.0
62
104
  type: :runtime
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
108
  - - '='
67
109
  - !ruby/object:Gem::Version
68
- version: 2.29.2
110
+ version: 2.30.0
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: bundler
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +174,8 @@ files:
132
174
  - ".ruby-version"
133
175
  - ".simplycop.yml"
134
176
  - ".simplycop_bundler.yml"
177
+ - ".simplycop_capybara.yml"
178
+ - ".simplycop_factory_bot.yml"
135
179
  - ".simplycop_gemspec.yml"
136
180
  - ".simplycop_layout.yml"
137
181
  - ".simplycop_lint.yml"
@@ -142,6 +186,7 @@ files:
142
186
  - ".simplycop_performance.yml"
143
187
  - ".simplycop_rails.yml"
144
188
  - ".simplycop_rspec.yml"
189
+ - ".simplycop_rspec_rails.yml"
145
190
  - ".simplycop_security.yml"
146
191
  - ".simplycop_style.yml"
147
192
  - CODEOWNERS
@@ -152,7 +197,6 @@ files:
152
197
  - _pipeline/stage_publishdocs.yml
153
198
  - _pipeline/stage_sast_tools.yml
154
199
  - bin/console
155
- - bin/setup
156
200
  - catalog-info.yaml
157
201
  - docs/index.md
158
202
  - lib/simplycop.rb
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here