rubocop-rspec 3.0.0 → 3.0.2

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: 32754bf73db99cc432fc432938ecd974e6fd047cd4689f9de21599fe18eb493c
4
- data.tar.gz: f997425aad7bf0300f80acdd9053bb616c7b3e3bdce289289043997af47a917d
3
+ metadata.gz: a04549578a5df31cc51ccb63edef6de85bb5a02365f4004a916307df9b192d94
4
+ data.tar.gz: 4fc0209d17164239f1e86b32da80b665ef597cb95fd8d2b71dd822e05c0f1c9b
5
5
  SHA512:
6
- metadata.gz: 98b044bfb078a0e3cb28804326174b60abecff57bb17b0ca86695fa1e2f7b6aeab2e52516bdb2d5d7dddb1e1e4f2caaf4a25ac9f25ae6196e42a7120ad7d722e
7
- data.tar.gz: ac61856c153771e059a900b2eb413c6fc79583d071c98dee7253a8783d81dcec492ff95e9de5dde1b6567637543b30501e6e9a7ad84a1bdbad3eb642344546e3
6
+ metadata.gz: d0436f1c4ae1685ce24163a3a46ac70a157afbb438ca556f8e63f1b7b6f8280fcf8dfa2fcb4c0e88e408d5b3857fa129e6ddbbae1e75ebdfc5c3dc89dabbc482
7
+ data.tar.gz: aff4399bc8a47869e4e2e3e183933bf768ca09d84973c627b13650686c65844beb8db333ecda4341a66ac2c29c928cc30b374d946cc43c029acd3c62ec7fce03
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 3.0.2 (2024-07-02)
6
+
7
+ - Fix wrong autocorrect for `RSpec/ScatteredSetup` when hook contains heredoc. ([@earlopain])
8
+ - Fix false negative for `RSpec/PredicateMatcher` when expectation contains custom failure message. ([@earlopain])
9
+ - Facilitate the 3.0 upgrade flow with proper extracted cop messages. ([@jeppester])
10
+
11
+ ## 3.0.1 (2024-06-11)
12
+
13
+ - Bump RuboCop requirement to +1.61. ([@ydah])
14
+
5
15
  ## 3.0.0 (2024-06-11)
6
16
 
7
17
  - Remove extracted cops in `Capybara`, `FactoryBot` and `Rails` departments. ([@ydah])
@@ -929,6 +939,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
929
939
  [@jaredmoody]: https://github.com/jaredmoody
930
940
  [@jdufresne]: https://github.com/jdufresne
931
941
  [@jeffreyc]: https://github.com/jeffreyc
942
+ [@jeppester]: https://github.com/jeppester
932
943
  [@jessieay]: https://github.com/jessieay
933
944
  [@jfragoulis]: https://github.com/jfragoulis
934
945
  [@johnny-miyake]: https://github.com/johnny-miyake
data/README.md CHANGED
@@ -7,6 +7,15 @@
7
7
  [RSpec](https://rspec.info/)-specific analysis for your projects, as an extension to
8
8
  [RuboCop](https://github.com/rubocop/rubocop).
9
9
 
10
+ - [Installation](#installation)
11
+ - [Upgrading to RuboCop RSpec v3.x](#upgrading-to-rubocop-rspec-v3x)
12
+ - [Upgrading to RuboCop RSpec v2.x](#upgrading-to-rubocop-rspec-v2x)
13
+ - [Usage](#usage)
14
+ - [Documentation](#documentation)
15
+ - [The Cops](#the-cops)
16
+ - [Contributing](#contributing)
17
+ - [License](#license)
18
+
10
19
  ## Installation
11
20
 
12
21
  Just install the `rubocop-rspec` gem
@@ -21,6 +30,10 @@ or if you use bundler put this in your `Gemfile`
21
30
  gem 'rubocop-rspec', require: false
22
31
  ```
23
32
 
33
+ ### Upgrading to RuboCop RSpec v3.x
34
+
35
+ Read all the details in our [Upgrade to Version 3.x](https://docs.rubocop.org/rubocop-rspec/3.0/upgrade_to_version_3.html) document.
36
+
24
37
  ### Upgrading to RuboCop RSpec v2.x
25
38
 
26
39
  Read all the details in our [Upgrade to Version 2.x](https://docs.rubocop.org/rubocop-rspec/2.0/upgrade_to_version_2.html) document.
@@ -13,28 +13,6 @@ changed_parameters:
13
13
  alternative: AllowedPatterns
14
14
  severity: warning
15
15
 
16
- renamed:
17
- RSpec/Capybara/CurrentPathExpectation: Capybara/CurrentPathExpectation
18
- RSpec/Capybara/MatchStyle: Capybara/MatchStyle
19
- RSpec/Capybara/NegationMatcher: Capybara/NegationMatcher
20
- RSpec/Capybara/SpecificActions: Capybara/SpecificActions
21
- RSpec/Capybara/SpecificFinders: Capybara/SpecificFinders
22
- RSpec/Capybara/SpecificMatcher: Capybara/SpecificMatcher
23
- RSpec/Capybara/VisibilityMatcher: Capybara/VisibilityMatcher
24
- RSpec/FactoryBot/AttributeDefinedStatically: FactoryBot/AttributeDefinedStatically
25
- RSpec/FactoryBot/ConsistentParenthesesStyle: FactoryBot/ConsistentParenthesesStyle
26
- RSpec/FactoryBot/CreateList: FactoryBot/CreateList
27
- RSpec/FactoryBot/FactoryClassName: FactoryBot/FactoryClassName
28
- RSpec/FactoryBot/FactoryNameStyle: FactoryBot/FactoryNameStyle
29
- RSpec/FactoryBot/SyntaxMethods: FactoryBot/SyntaxMethods
30
- RSpec/Rails/AvoidSetupHook: RSpecRails/AvoidSetupHook
31
- RSpec/Rails/HaveHttpStatus: RSpecRails/HaveHttpStatus
32
- RSpec/Rails/HttpStatus: RSpecRails/HttpStatus
33
- RSpec/Rails/InferredSpecType: RSpecRails/InferredSpecType
34
- RSpec/Rails/MinitestAssertions: RSpecRails/MinitestAssertions
35
- RSpec/Rails/NegationBeValid: RSpecRails/NegationBeValid
36
- RSpec/Rails/TravelAround: RSpecRails/TravelAround
37
-
38
16
  split:
39
17
  RSpec/FilePath:
40
18
  alternatives:
@@ -45,3 +23,8 @@ removed:
45
23
  RSpec/Capybara/FeatureMethods:
46
24
  reason: >
47
25
  this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead
26
+
27
+ extracted:
28
+ RSpec/Rails/*: rubocop-rspec_rails
29
+ RSpec/FactoryBot/*: rubocop-factory_bot
30
+ RSpec/Capybara/*: rubocop-capybara
@@ -32,7 +32,7 @@ module RuboCop
32
32
  (block $(send !nil? #predicate? ...) ...)
33
33
  $(send !nil? #predicate? ...)})
34
34
  $#Runners.all
35
- $#boolean_matcher?)
35
+ $#boolean_matcher? ...)
36
36
  PATTERN
37
37
 
38
38
  # @!method be_bool?(node)
@@ -183,8 +183,12 @@ module RuboCop
183
183
  (send
184
184
  (send nil? :expect $!nil?)
185
185
  #Runners.all
186
- {$(send nil? #predicate_matcher_name? ...)
187
- (block $(send nil? #predicate_matcher_name? ...) ...)})
186
+ {
187
+ $(send nil? #predicate_matcher_name? ...)
188
+ (block $(send nil? #predicate_matcher_name? ...) ...)
189
+ }
190
+ ...
191
+ )
188
192
  PATTERN
189
193
 
190
194
  # @!method predicate_matcher_block?(node)
@@ -23,6 +23,7 @@ module RuboCop
23
23
  # end
24
24
  #
25
25
  class ScatteredSetup < Base
26
+ include FinalEndLocation
26
27
  include RangeHelp
27
28
  extend AutoCorrector
28
29
 
@@ -75,8 +76,13 @@ module RuboCop
75
76
  def autocorrect(corrector, first_occurrence, occurrence)
76
77
  return if first_occurrence == occurrence || !first_occurrence.body
77
78
 
79
+ # Take heredocs into account
80
+ body = occurrence.body&.source_range&.with(
81
+ end_pos: final_end_location(occurrence).begin_pos
82
+ )
83
+
78
84
  corrector.insert_after(first_occurrence.body,
79
- "\n#{occurrence.body&.source}")
85
+ "\n#{body&.source}")
80
86
  corrector.remove(range_by_whole_lines(occurrence.source_range,
81
87
  include_final_newline: true))
82
88
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '3.0.0'
7
+ STRING = '3.0.2'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-06-11 00:00:00.000000000 Z
13
+ date: 2024-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.40'
21
+ version: '1.61'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.40'
28
+ version: '1.61'
29
29
  description: |
30
30
  Code style checking for RSpec files.
31
31
  A plugin for the RuboCop code style enforcing & linting tool.
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.5.9
210
+ rubygems_version: 3.5.11
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: Code style checking for RSpec files