Skip to content

Commit

Permalink
Enable RSpec/MatchArray (#9820)
Browse files Browse the repository at this point in the history
* Enable RSpec/LetBeforeExamples

* Enable RSpec/MatchArray

* fixing issues from rebase

* Inserted missing end

* vscode syntax fixes

* updated code to fix Lint issues based on other cops

---------

Co-authored-by: Garry L Hurley Jr <166545206+GarryHurleyJr@users.noreply.github.com>
Co-authored-by: garryhurleyjr <garryhurleyjr@github.com>
  • Loading branch information
3 people authored Jun 10, 2024
1 parent 3bf74b8 commit db38e85
Show file tree
Hide file tree
Showing 38 changed files with 1,195 additions and 1,558 deletions.
10 changes: 6 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ RSpec/IteratedExpectation:
- 'python/spec/dependabot/python/file_updater/requirement_file_updater_spec.rb'
- 'python/spec/dependabot/python/file_updater_spec.rb'

# Offense count: 141
# This cop supports safe autocorrection (--autocorrect).
RSpec/MatchArray:
Enabled: false

# Offense count: 3
RSpec/MessageChain:
Expand Down Expand Up @@ -137,6 +133,12 @@ RSpec/MultipleExpectations:
RSpec/MultipleMemoizedHelpers:
Max: 30

# Offense count: 500
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Enabled: false

# Offense count: 3871
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
"files.trimTrailingWhitespace": true
},
"rubocop.autocorrect": true,
"sorbet.enabled": true
"sorbet.enabled": true,
"rubocop.layoutMode": true,
"rubocop.lintMode": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,52 +42,42 @@
let(:target_version) { "6.0.0" }

it "returns a list of dependencies that block the update" do
expect(conflicting_dependencies).to match_array(
[
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0)",
"name" => "rails",
"requirement" => "= 5.2.0",
"version" => "5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionpack (5.2.0)",
"name" => "actionpack",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionview (5.2.0)",
"name" => "actionview",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activejob (5.2.0)",
"name" => "activejob",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activemodel (5.2.0)",
"name" => "activemodel",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activerecord (5.2.0)",
"name" => "activerecord",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via railties (5.2.0)",
"name" => "railties",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}
]
)
expect(conflicting_dependencies).to contain_exactly({
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0)",
"name" => "rails",
"requirement" => "= 5.2.0",
"version" => "5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionpack (5.2.0)",
"name" => "actionpack",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionview (5.2.0)",
"name" => "actionview",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activejob (5.2.0)",
"name" => "activejob",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activemodel (5.2.0)",
"name" => "activemodel",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activerecord (5.2.0)",
"name" => "activerecord",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via railties (5.2.0)",
"name" => "railties",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
})
end
end

Expand All @@ -98,28 +88,22 @@
let(:project_name) { "multiple_blocking" }

it "returns all of the blocking dependencies" do
expect(conflicting_dependencies).to match_array(
[
{
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via actionpack (5.0.0)",
"name" => "actionpack",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
},
{
"explanation" => "actionview (5.0.0) requires activesupport (= 5.0.0)",
"name" => "actionview",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
},
{
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via activejob (5.0.0)",
"name" => "activejob",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}
]
)
expect(conflicting_dependencies).to contain_exactly({
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via actionpack (5.0.0)",
"name" => "actionpack",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}, {
"explanation" => "actionview (5.0.0) requires activesupport (= 5.0.0)",
"name" => "actionview",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}, {
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via activejob (5.0.0)",
"name" => "activejob",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
})
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,52 +42,42 @@
let(:target_version) { "6.0.0" }

it "returns a list of dependencies that block the update" do
expect(conflicting_dependencies).to match_array(
[
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0)",
"name" => "rails",
"requirement" => "= 5.2.0",
"version" => "5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionpack (5.2.0)",
"name" => "actionpack",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionview (5.2.0)",
"name" => "actionview",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activejob (5.2.0)",
"name" => "activejob",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activemodel (5.2.0)",
"name" => "activemodel",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activerecord (5.2.0)",
"name" => "activerecord",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
},
{
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via railties (5.2.0)",
"name" => "railties",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}
]
)
expect(conflicting_dependencies).to contain_exactly({
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0)",
"name" => "rails",
"requirement" => "= 5.2.0",
"version" => "5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionpack (5.2.0)",
"name" => "actionpack",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via actionview (5.2.0)",
"name" => "actionview",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activejob (5.2.0)",
"name" => "activejob",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activemodel (5.2.0)",
"name" => "activemodel",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via activerecord (5.2.0)",
"name" => "activerecord",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
}, {
"explanation" => "rails (5.2.0) requires activesupport (= 5.2.0) via railties (5.2.0)",
"name" => "railties",
"version" => "5.2.0",
"requirement" => "= 5.2.0"
})
end
end

Expand All @@ -98,28 +88,22 @@
let(:project_name) { "multiple_blocking" }

it "returns all of the blocking dependencies" do
expect(conflicting_dependencies).to match_array(
[
{
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via actionpack (5.0.0)",
"name" => "actionpack",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
},
{
"explanation" => "actionview (5.0.0) requires activesupport (= 5.0.0)",
"name" => "actionview",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
},
{
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via activejob (5.0.0)",
"name" => "activejob",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}
]
)
expect(conflicting_dependencies).to contain_exactly({
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via actionpack (5.0.0)",
"name" => "actionpack",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}, {
"explanation" => "actionview (5.0.0) requires activesupport (= 5.0.0)",
"name" => "actionview",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
}, {
"explanation" => "actionmailer (5.0.0) requires activesupport (= 5.0.0) via activejob (5.0.0)",
"name" => "activejob",
"version" => "5.0.0",
"requirement" => "= 5.0.0"
})
end
end

Expand Down
Loading

0 comments on commit db38e85

Please sign in to comment.