brew vendor-gems: commit updates.
This commit is contained in:
parent
b8c0a2b719
commit
e708302aed
@ -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