Skip to content

Commit

Permalink
Merge pull request #7930 from openSUSE/depfu/update/srcapi/rubocop-0.…
Browse files Browse the repository at this point in the history
…73.0

[src/api] Update rubocop: 0.72.0 → 0.73.0 (major)
  • Loading branch information
eduardoj authored Jul 17, 2019
2 parents 02d5f76 + 0421356 commit d7d1a3a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
5 changes: 5 additions & 0 deletions src/api/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Style/MultilineBlockChain:
Exclude:
- 'spec/**/*'

# We decided not to modify old migrations
Style/MultilineWhenThen:
Exclude:
- 'db/migrate/20140908125426_convert_request_history.rb'

# We disabled this cop because HAML doesn't work well with ActiveSupport::SafeBuffer and the to_s method of it is always returning the same object class
Style/UnneededInterpolation:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion src/api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ GEM
rspec-support (3.8.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.72.0)
rubocop (0.73.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
Expand Down
26 changes: 13 additions & 13 deletions src/api/app/helpers/webui/request_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ def common_parts(req)
def map_request_type(type)
# for a simplified view on a request, must be used only for lists
case type
when :change_devel then
when :change_devel
'chgdev'
when :set_bugowner then
when :set_bugowner
'bugowner'
when :add_role then
when :add_role
'addrole'
when :maintenance_incident then
when :maintenance_incident
'incident'
when :maintenance_release then
when :maintenance_release
'release'
else
type.to_s
Expand All @@ -86,26 +86,26 @@ def map_request_type(type)

def priority_description(prio)
case prio
when 'low' then
when 'low'
'Work on this request if nothing else needs to be done.'
when 'moderate' then
when 'moderate'
'Work on this request.'
when 'important' then
when 'important'
'Finish other requests you have begun, then work on this request.'
when 'critical' then
when 'critical'
'Drop everything and work on this request.'
end
end

def priority_number(prio)
case prio
when 'low' then
when 'low'
'1'
when 'moderate' then
when 'moderate'
'2'
when 'important' then
when 'important'
'3'
when 'critical' then
when 'critical'
'4'
end
end
Expand Down
14 changes: 7 additions & 7 deletions src/api/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -606,20 +606,20 @@ def change_state(opts)

params = { request: self, comment: opts[:comment], user_id: User.session!.id }
case opts[:newstate]
when 'accepted' then
when 'accepted'
history = HistoryElement::RequestAccepted
when 'declined' then
when 'declined'
history = HistoryElement::RequestDeclined
when 'revoked' then
when 'revoked'
history = HistoryElement::RequestRevoked
when 'superseded' then
history = HistoryElement::RequestSuperseded
params[:description_extension] = superseded_by.to_s
when 'review' then
when 'review'
history = HistoryElement::RequestReopened
when 'new' then
when 'new'
history = HistoryElement::RequestReopened
when 'deleted' then
when 'deleted'
history = HistoryElement::RequestDeleted
else
raise "Unhandled state #{opts[:newstate]} for history"
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def webui_actions(opts = {})
action[:role] = xml.role
action[:user] = xml.person_name
action[:group] = xml.group_name
when :change_devel then
when :change_devel
action[:name] = 'Change Devel'
when :set_bugowner then
action[:name] = 'Set Bugowner'
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/user_ldap_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def self.find_with_ldap(login, password)
end
# Attempt to authenticate user
case CONFIG['ldap_authenticate']
when :local then
when :local
unless authenticate_with_local(password, user)
Rails.logger.info("Unable to local authenticate #{user['dn']}")
return
Expand Down
28 changes: 14 additions & 14 deletions src/api/app/presenters/obs_factory/staging_project_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ def description_packages
# engine helpers are troublesome, so we avoid them
def self.review_icon(reviewer)
case reviewer
when 'opensuse-review-team', 'autobuild-team' then
when 'opensuse-review-team', 'autobuild-team'
'search'
when 'repo-checker' then
when 'repo-checker'
'cog'
when 'sle-release-managers', 'leap-reviewers', 'caasp-release-managers', 'backports-reviewers' then
when 'sle-release-managers', 'leap-reviewers', 'caasp-release-managers', 'backports-reviewers'
'users'
when 'security-team' then
when 'security-team'
'user-shield'
when 'maintenance-team' then
when 'maintenance-team'
'medkit'
when 'legal-team', 'legal-auto', 'licensedigger' then
when 'legal-team', 'legal-auto', 'licensedigger'
'graduation-cap'
when 'leaper', 'origin-manager' then
when 'leaper', 'origin-manager'
'code-fork'
when 'sle-changelog-checker' then
when 'sle-changelog-checker'
'tags'
else
'ban'
Expand Down Expand Up @@ -147,17 +147,17 @@ def testing_url
# the lower the number, the earlier it is in the list - acceptable A first
def sort_key
main = case overall_state
when :acceptable then
when :acceptable
0
when :review then
when :review
10000 - review_percentage * 100
when :testing then
when :testing
20000 - testing_percentage * 100
when :building then
when :building
30000 - build_progress[:percentage] * 100
when :failed then
when :failed
40000
when :unacceptable then
when :unacceptable
50000
when :empty
60000
Expand Down

0 comments on commit d7d1a3a

Please sign in to comment.