Skip to content

Commit

Permalink
Merge pull request #10247 from OleksandrOrlov/rubocop_binary_operator
Browse files Browse the repository at this point in the history
Address RuboCop TODOs
  • Loading branch information
krauselukas committed Oct 2, 2020
2 parents 94f9a10 + d94723e commit 70a164c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 27 deletions.
22 changes: 0 additions & 22 deletions src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Lint/BinaryOperatorWithIdenticalOperands:
Exclude:
- 'app/models/bs_request.rb'
- 'spec/models/bs_request_action/differ/for_source_spec.rb'

# Offense count: 7
Lint/ConstantDefinitionInBlock:
Exclude:
Expand All @@ -21,17 +15,6 @@ Lint/ConstantDefinitionInBlock:
- 'lib/tasks/statistics/github/pull_requests.rake'
- 'spec/support/database_cleaner.rb'

# Offense count: 1
Lint/DuplicateMethods:
Exclude:
- 'app/models/history_element/base.rb'

# Offense count: 1
# Configuration parameters: AllowComments.
Lint/EmptyFile:
Exclude:
- 'spec/models/bs_request/differ/query_builder.rb'

# Offense count: 8
# Configuration parameters: MaximumRangeSize.
Lint/MissingCopEnableDirective:
Expand Down Expand Up @@ -451,11 +434,6 @@ Naming/AccessorMethodName:
- 'app/models/user.rb'
- 'test/functional/search_controller_test.rb'

# Offense count: 1
Naming/ConstantName:
Exclude:
- 'test/unit/issue_test.rb'

# Offense count: 22
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def change_state(opts)
end

def assignreview(opts = {})
raise InvalidStateError, 'request is not in review state' unless state == :review || (state == :new && state == :new)
raise InvalidStateError, 'request is not in review state' unless state == :review || state == :new

reviewer = User.find_by_login!(opts[:reviewer])

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/history_element/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Base < ApplicationRecord
self.table_name = 'history_elements'

class << self
attr_accessor :description, :raw_type, :comment, :raw_type, :created_at, :raw_type
attr_accessor :description, :comment, :created_at
end

def color
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
)
end

it { expect(subject.perform).to eq(xml_response + xml_response) }
it { expect(subject.perform).to eq(xml_response * 2) }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/test/unit/issue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class IssueTest < ActiveSupport::TestCase
fixtures :all

# rubocop:disable Layout/LineLength
BugGet0815 = "<?xml version=\"1.0\" ?><methodCall><methodName>Bug.get</methodName><params><param><value><struct><member><name>ids</name><value><array><data><value><string>1234</string></value><value><string>0815</string></value></data></array></value></member><member><name>permissive</name><value><i4>1</i4></value></member></struct></value></param></params></methodCall>\n".freeze
BUG_GET_0815 = "<?xml version=\"1.0\" ?><methodCall><methodName>Bug.get</methodName><params><param><value><struct><member><name>ids</name><value><array><data><value><string>1234</string></value><value><string>0815</string></value></data></array></value></member><member><name>permissive</name><value><i4>1</i4></value></member></struct></value></param></params></methodCall>\n".freeze
# rubocop:enable Layout/LineLength

def test_parse
Expand All @@ -15,7 +15,7 @@ def test_parse

def test_create_and_destroy
stub_request(:post, 'http://bugzilla.novell.com/xmlrpc.cgi')
.with(body: BugGet0815)
.with(body: BUG_GET_0815)
.to_return(status: 200,
body: load_backend_file('bugzilla_get_0815.xml'),
headers: {})
Expand Down

0 comments on commit 70a164c

Please sign in to comment.