-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
standard-1-37-0 #4
Changes from 5 commits
c39b454
65e2693
9fccafb
31117db
90fbd13
35db219
05d66bf
bf30535
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ source "https://rubygems.org" | |
|
||
gem "activesupport", require: false | ||
gem "mry", "~> 0.52.0", require: false | ||
gem "parser", "~> 3.0.2" | ||
gem "parser", "~> 3.3.0" | ||
gem "pry", require: false | ||
gem "safe_yaml" | ||
gem "standard", "~> 1.4", require: false | ||
gem "standard", "1.37.0", require: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hardlocked without twiddle wakka to emphasize this is the last version before ruby 3 is a minimum requirement for |
||
|
||
group :test do | ||
gem "rake" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require "spec_helper" | ||
require "cc/engine/issue" | ||
require "ostruct" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This spec and the one below was failing after the gem updates due to needing uninitialized constant CC::Engine::OpenStruct |
||
|
||
module CC::Engine | ||
describe Issue do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ module CC::Engine | |
expect { config.validate }.to output(<<~TXT).to_stderr | ||
The `Style/TrailingComma` cop has been removed. Please use `Style/TrailingCommaInArguments`, `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. | ||
(obsolete configuration found in .rubocop.yml, please update it) | ||
unrecognized cop Style/TrailingComma found in .rubocop.yml | ||
unrecognized cop or department Style/TrailingComma found in .rubocop.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On master without any changes at all, this is failing. Seems that |
||
Did you mean `Style/TrailingCommaInArguments`? | ||
TXT | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ RuboCop::Cop::Lint::Syntax | |
RuboCop::Cop::Migration::DepartmentName | ||
RuboCop::Cop::Style::ConditionalAssignment | ||
RuboCop::Cop::Style::DoubleCopDisableDirective | ||
RuboCop::Cop::Style::BlockDelimiters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, on master without any changes, this too is also failing a spec (even after running "#{cop.name} has no content ..." |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
module StandardRunner | ||
def self.included(example_group) | ||
example_group.include FilesystemHelpers | ||
example_group.before do | ||
allow_any_instance_of(RuboCop::AST::ProcessedSource).to receive(:registry).and_return(registry) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after the updates (due to
If you add a
and points to this line of code in the That is what i've done here by borrowing from the code suggested as a fix in that github issue using |
||
end | ||
example_group.around do |example| | ||
Dir.mktmpdir do |code| | ||
@code = code | ||
|
@@ -21,10 +24,22 @@ def issues(output = @engine_output) | |
end | ||
|
||
def run_engine(config = nil) | ||
@config = config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set as an instance variable now so if config arg was passed into this (which it is in at least one spec in this repo) then we use that when generating the |
||
io = StringIO.new | ||
standard = CC::Engine::Standard.new(@code, config, io) | ||
standard = CC::Engine::Standard.new(@code, @config, io) | ||
standard.run | ||
|
||
@engine_output = io.string | ||
end | ||
|
||
def registry | ||
# https://github.com/rubocop/rubocop/blob/master/lib/rubocop/rspec/cop_helper.rb | ||
@registry ||= begin | ||
keys = RuboCop::Config.new(@config || {}, "#{Dir.pwd}/.rubocop.yml").keys | ||
cops = keys.map { |directive| RuboCop::Cop::Registry.global.find_cops_by_directive(directive) }.flatten | ||
cops << cop_class if defined?(cop_class) && !cops.include?(cop_class) | ||
cops.compact! | ||
RuboCop::Cop::Registry.new(cops) | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required in order to satisfy gem dependencies