Skip to content

Commit

Permalink
chore: Fix RuboCop Style/FormatStringToken (lostisland#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
htwroclau authored and olleolleolle committed Mar 3, 2019
1 parent d657e3d commit 801f7d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
11 changes: 1 addition & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-03-03 10:30:09 +0100 using RuboCop version 0.65.0.
# on 2019-03-03 20:17:49 +0900 using RuboCop version 0.65.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -77,15 +77,6 @@ Style/DoubleNegation:
- 'lib/faraday/options/env.rb'
- 'lib/faraday/response.rb'

# Offense count: 9
# Configuration parameters: EnforcedStyle.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
Exclude:
- 'lib/faraday/encoders/nested_params_encoder.rb'
- 'test/adapters/integration.rb'
- 'test/live_server.rb'

# Offense count: 2
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/encoders/nested_params_encoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def self.decode(query)
if !last_subkey || is_array
value_type = is_array ? Array : Hash
if context[subkey] && !context[subkey].is_a?(value_type)
raise TypeError, format("expected %s (got %s) for param `%s'", value_type.name, context[subkey].class.name, subkey)
raise TypeError, format("expected #{value_type.name} (got #{context[subkey].class.name}) for param `#{subkey}'")
end

context = (context[subkey] ||= value_type.new)
Expand Down
2 changes: 1 addition & 1 deletion test/adapters/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def create_connection(options = {}, &optional_connection_config_blk)
end

server = self.class.live_server
url = format('%s://%s:%d', server.scheme, server.host, server.port)
url = format("#{server.scheme}://#{server.host}:#{server.port}")

options[:ssl] ||= {}
options[:ssl][:ca_file] ||= ENV['SSL_FILE']
Expand Down
2 changes: 1 addition & 1 deletion test/live_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LiveServer < Sinatra::Base

post '/file' do
if params[:uploaded_file].respond_to? :each_key
format('file %s %s %d', params[:uploaded_file][:filename], params[:uploaded_file][:type], params[:uploaded_file][:tempfile].size)
format("file #{params[:uploaded_file][:filename]} #{params[:uploaded_file][:type]} #{params[:uploaded_file][:tempfile].size}")
else
status 400
end
Expand Down

0 comments on commit 801f7d5

Please sign in to comment.