Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d96c73ca
Commit
d96c73ca
authored
Sep 03, 2020
by
Rajendra Kadam
Committed by
Rémy Coutable
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/RedundantSort cop
parent
06eb502b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
.rubocop_todo.yml
.rubocop_todo.yml
+0
-7
app/presenters/packages/nuget/search_results_presenter.rb
app/presenters/packages/nuget/search_results_presenter.rb
+1
-1
changelogs/unreleased/redundant-sort-cop.yml
changelogs/unreleased/redundant-sort-cop.yml
+5
-0
spec/presenters/packages/nuget/search_results_presenter_spec.rb
...resenters/packages/nuget/search_results_presenter_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
d96c73ca
...
@@ -676,13 +676,6 @@ Style/RedundantInterpolation:
...
@@ -676,13 +676,6 @@ Style/RedundantInterpolation:
Style/RedundantSelf
:
Style/RedundantSelf
:
Enabled
:
false
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantSort
:
Exclude
:
-
'
app/presenters/packages/nuget/search_results_presenter.rb'
-
'
spec/presenters/packages/nuget/search_results_presenter_spec.rb'
# Offense count: 120
# Offense count: 120
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
...
...
app/presenters/packages/nuget/search_results_presenter.rb
View file @
d96c73ca
...
@@ -49,7 +49,7 @@ module Packages
...
@@ -49,7 +49,7 @@ module Packages
def
latest_version
(
packages
)
def
latest_version
(
packages
)
versions
=
packages
.
map
(
&
:version
).
compact
versions
=
packages
.
map
(
&
:version
).
compact
VersionSorter
.
sort
(
versions
).
last
# rubocop: disable Style/
Unneeded
Sort
VersionSorter
.
sort
(
versions
).
last
# rubocop: disable Style/
Redundant
Sort
end
end
end
end
end
end
...
...
changelogs/unreleased/redundant-sort-cop.yml
0 → 100644
View file @
d96c73ca
---
title
:
Fix Style/RedundantSort cop
merge_request
:
41108
author
:
Rajendra Kadam
type
:
fixed
spec/presenters/packages/nuget/search_results_presenter_spec.rb
View file @
d96c73ca
...
@@ -37,7 +37,7 @@ RSpec.describe Packages::Nuget::SearchResultsPresenter do
...
@@ -37,7 +37,7 @@ RSpec.describe Packages::Nuget::SearchResultsPresenter do
expect
(
package_json
[
:summary
]).
to
be_blank
expect
(
package_json
[
:summary
]).
to
be_blank
expect
(
package_json
[
:total_downloads
]).
to
eq
0
expect
(
package_json
[
:total_downloads
]).
to
eq
0
expect
(
package_json
[
:verified
]).
to
be
expect
(
package_json
[
:verified
]).
to
be
expect
(
package_json
[
:version
]).
to
eq
VersionSorter
.
sort
(
versions
).
last
# rubocop: disable Style/
Unneeded
Sort
expect
(
package_json
[
:version
]).
to
eq
VersionSorter
.
sort
(
versions
).
last
# rubocop: disable Style/
Redundant
Sort
versions
.
zip
(
package_json
[
:versions
]).
each
do
|
version
,
version_json
|
versions
.
zip
(
package_json
[
:versions
]).
each
do
|
version
,
version_json
|
expect
(
version_json
[
:json_url
]).
to
end_with
(
"
#{
version
}
.json"
)
expect
(
version_json
[
:json_url
]).
to
end_with
(
"
#{
version
}
.json"
)
expect
(
version_json
[
:downloads
]).
to
eq
0
expect
(
version_json
[
:downloads
]).
to
eq
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment