Merge pull request #12401 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rspec-2.6.0
build(deps): bump rubocop-rspec from 2.5.0 to 2.6.0 in /Library/Homebrew
This commit is contained in:
commit
08e3b22cc2
@ -142,7 +142,7 @@ GEM
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-rspec (2.5.0)
|
||||
rubocop-rspec (2.6.0)
|
||||
rubocop (~> 1.19)
|
||||
rubocop-sorbet (0.6.2)
|
||||
rubocop
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for types exported from the `rubocop-rspec` gem.
|
||||
# Please instead update this file by running `bin/tapioca gem rubocop-rspec`.
|
||||
|
||||
# typed: true
|
||||
|
||||
module RuboCop; end
|
||||
module RuboCop::Cop; end
|
||||
module RuboCop::Cop::Layout; end
|
||||
@ -1505,11 +1505,13 @@ RuboCop::Cop::RSpec::Variable::Subjects = RuboCop::RSpec::Language::Subjects
|
||||
class RuboCop::Cop::RSpec::VariableDefinition < ::RuboCop::Cop::RSpec::Base
|
||||
include ::RuboCop::Cop::ConfigurableEnforcedStyle
|
||||
include ::RuboCop::Cop::RSpec::Variable
|
||||
extend ::RuboCop::Cop::AutoCorrector
|
||||
|
||||
def on_send(node); end
|
||||
|
||||
private
|
||||
|
||||
def correct_variable(variable); end
|
||||
def string?(node); end
|
||||
def style_violation?(variable); end
|
||||
def symbol?(node); end
|
||||
@ -1585,6 +1587,8 @@ module RuboCop::RSpec; end
|
||||
|
||||
class RuboCop::RSpec::AlignLetBrace
|
||||
include ::RuboCop::RSpec::Language
|
||||
include ::RuboCop::PathUtil
|
||||
include ::RuboCop::Cop::Util
|
||||
|
||||
def initialize(root, token); end
|
||||
|
||||
@ -89,7 +89,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.22.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.12.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.12.4/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.5.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.6.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib"
|
||||
|
||||
@ -1,11 +1,24 @@
|
||||
---
|
||||
RSpec:
|
||||
Enabled: true
|
||||
Include:
|
||||
Include: &1
|
||||
- "**/*_spec.rb"
|
||||
- "**/spec/**/*"
|
||||
Language:
|
||||
Language: &2
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Expectations
|
||||
- Helpers
|
||||
- Hooks
|
||||
- HookScopes
|
||||
- Runners
|
||||
- Subjects
|
||||
ExampleGroups:
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Regular
|
||||
- Skipped
|
||||
- Focused
|
||||
Regular:
|
||||
- describe
|
||||
- context
|
||||
@ -20,6 +33,12 @@ RSpec:
|
||||
- fcontext
|
||||
- ffeature
|
||||
Examples:
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Regular
|
||||
- Skipped
|
||||
- Focused
|
||||
- Pending
|
||||
Regular:
|
||||
- it
|
||||
- specify
|
||||
@ -62,6 +81,10 @@ RSpec:
|
||||
- all
|
||||
- suite
|
||||
Includes:
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Examples
|
||||
- Context
|
||||
Examples:
|
||||
- it_behaves_like
|
||||
- it_should_behave_like
|
||||
@ -73,6 +96,10 @@ RSpec:
|
||||
- to_not
|
||||
- not_to
|
||||
SharedGroups:
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Examples
|
||||
- Context
|
||||
Examples:
|
||||
- shared_examples
|
||||
- shared_examples_for
|
||||
@ -718,6 +745,11 @@ RSpec/Yield:
|
||||
VersionAdded: '1.32'
|
||||
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
||||
|
||||
RSpec/Capybara:
|
||||
Enabled: true
|
||||
Include: *1
|
||||
Language: *2
|
||||
|
||||
RSpec/Capybara/CurrentPathExpectation:
|
||||
Description: Checks that no expectations are set on Capybara's `current_path`.
|
||||
Enabled: true
|
||||
@ -740,6 +772,11 @@ RSpec/Capybara/VisibilityMatcher:
|
||||
VersionChanged: '2.0'
|
||||
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher
|
||||
|
||||
RSpec/FactoryBot:
|
||||
Enabled: true
|
||||
Include: *1
|
||||
Language: *2
|
||||
|
||||
RSpec/FactoryBot/AttributeDefinedStatically:
|
||||
Description: Always declare attribute values as blocks.
|
||||
Enabled: true
|
||||
@ -779,6 +816,11 @@ RSpec/FactoryBot/FactoryClassName:
|
||||
VersionChanged: '2.0'
|
||||
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
|
||||
|
||||
RSpec/Rails:
|
||||
Enabled: true
|
||||
Include: *1
|
||||
Language: *2
|
||||
|
||||
RSpec/Rails/AvoidSetupHook:
|
||||
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
|
||||
Enabled: pending
|
||||
@ -60,7 +60,10 @@ module RuboCop
|
||||
|
||||
def add_wording_offense(node, message)
|
||||
docstring = docstring(node)
|
||||
|
||||
add_offense(docstring, message: message) do |corrector|
|
||||
next if node.heredoc?
|
||||
|
||||
corrector.replace(docstring, replacement_text(node))
|
||||
end
|
||||
end
|
||||
@ -37,6 +37,8 @@ module RuboCop
|
||||
|
||||
def on_send(node)
|
||||
example_description(node) do |description_node, message|
|
||||
return if description_node.heredoc?
|
||||
|
||||
text = text(message)
|
||||
|
||||
return unless excessive_whitespace?(text)
|
||||
@ -49,7 +51,9 @@ module RuboCop
|
||||
|
||||
# @param text [String]
|
||||
def excessive_whitespace?(text)
|
||||
text.start_with?(' ') || text.include?(' ') || text.end_with?(' ')
|
||||
return true if text.start_with?(' ') || text.end_with?(' ')
|
||||
|
||||
text.match?(/[^\n ] +[^ ]/)
|
||||
end
|
||||
|
||||
# @param text [String]
|
||||
@ -23,6 +23,7 @@ module RuboCop
|
||||
# subject('user') { create_user }
|
||||
# let('user_name') { 'Adam' }
|
||||
class VariableDefinition < Base
|
||||
extend AutoCorrector
|
||||
include ConfigurableEnforcedStyle
|
||||
include Variable
|
||||
|
||||
@ -30,14 +31,30 @@ module RuboCop
|
||||
|
||||
def on_send(node)
|
||||
variable_definition?(node) do |variable|
|
||||
if style_violation?(variable)
|
||||
add_offense(variable, message: format(MSG, style: style))
|
||||
next unless style_violation?(variable)
|
||||
|
||||
add_offense(
|
||||
variable,
|
||||
message: format(MSG, style: style)
|
||||
) do |corrector|
|
||||
corrector.replace(variable, correct_variable(variable))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def correct_variable(variable)
|
||||
case variable.type
|
||||
when :dsym
|
||||
variable.source[1..-1]
|
||||
when :sym
|
||||
variable.value.to_s.inspect
|
||||
else
|
||||
variable.value.to_sym.inspect
|
||||
end
|
||||
end
|
||||
|
||||
def style_violation?(variable)
|
||||
style == :symbols && string?(variable) ||
|
||||
style == :strings && symbol?(variable)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user