Skip to content
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

[Ruby] Fix obsolete configuration of Rubocop and Rubocop's warns (#5417) #5474

Merged
merged 3 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe {{moduleName}}::ApiClient do
end

it 'fails for invalid collection format' do
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ AllCops:
Style/AndOr:
Enabled: true

# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Expand All @@ -57,7 +51,7 @@ Style/HashSyntax:
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
EnforcedStyle: indented_internal_methods

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Expand Down Expand Up @@ -123,15 +117,15 @@ Layout/Tab:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: false

# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
Expand Down
14 changes: 4 additions & 10 deletions samples/client/petstore/ruby-faraday/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ AllCops:
Style/AndOr:
Enabled: true

# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Expand All @@ -57,7 +51,7 @@ Style/HashSyntax:
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
EnforcedStyle: indented_internal_methods

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Expand Down Expand Up @@ -123,15 +117,15 @@ Layout/Tab:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: false

# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
Expand Down
14 changes: 4 additions & 10 deletions samples/client/petstore/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ AllCops:
Style/AndOr:
Enabled: true

# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Expand All @@ -57,7 +51,7 @@ Style/HashSyntax:
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
EnforcedStyle: indented_internal_methods

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Expand Down Expand Up @@ -123,15 +117,15 @@ Layout/Tab:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: false

# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby/spec/api_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
end

it 'fails for invalid collection format' do
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
end
end

Expand Down
14 changes: 4 additions & 10 deletions samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ AllCops:
Style/AndOr:
Enabled: true

# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Expand All @@ -57,7 +51,7 @@ Style/HashSyntax:
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
EnforcedStyle: indented_internal_methods

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Expand Down Expand Up @@ -123,15 +117,15 @@ Layout/Tab:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: false

# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
end

it 'fails for invalid collection format' do
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
end
end

Expand Down
14 changes: 4 additions & 10 deletions samples/openapi3/client/petstore/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ AllCops:
Style/AndOr:
Enabled: true

# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Expand All @@ -57,7 +51,7 @@ Style/HashSyntax:
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
EnforcedStyle: indented_internal_methods

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Expand Down Expand Up @@ -123,15 +117,15 @@ Layout/Tab:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: false

# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
end

it 'fails for invalid collection format' do
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
end
end

Expand Down