Skip to content

Commit

Permalink
Enable Layout/TrailingWhitespace cop to prevent extra trailing spac…
Browse files Browse the repository at this point in the history
…e in future
  • Loading branch information
kamipo authored and ioquatix committed Jan 22, 2020
1 parent b4260c9 commit 99d1da8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ Layout/SpaceBeforeFirstArg:
# Use `{ a: 1 }` not `{a:1}`.
Layout/SpaceInsideHashLiteralBraces:
Enabled: true

Layout/TrailingWhitespace:
Enabled: true
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ c_platforms = Bundler::Dsl::VALID_PLATFORMS.dup.delete_if do |platform|
platform =~ /jruby/
end

gem "rubocop", "0.68.1", require: false
gem "rubocop", require: false

# Alternative solution that might work, but it has bad interactions with
# Gemfile.lock if that gets committed/reused:
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class MockResponse < Rack::Response
class << self
alias [] new
end

# Headers
attr_reader :original_headers, :cookies

Expand Down
2 changes: 1 addition & 1 deletion lib/rack/multipart/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def tag_multipart_encoding(filename, content_type, name, body)
type_subtype = list.first
type_subtype.strip!
if TEXT_PLAIN == type_subtype
rest = list.drop 1
rest = list.drop 1
rest.each do |param|
k, v = param.split('=', 2)
k.strip!
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Response
def self.[](status, headers, body)
self.new(body, status, headers)
end

attr_accessor :length, :status, :body
attr_reader :header
alias headers header
Expand Down
2 changes: 1 addition & 1 deletion test/spec_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def files(*args)
request = Rack::Request.new(
Rack::MockRequest.env_for("/cgi/test")
)

file_path = File.expand_path("cgi/test", __dir__)
status, headers, body = app.serving(request, file_path)
assert_equal 200, status
Expand Down
2 changes: 1 addition & 1 deletion test/spec_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
response.headers.must_equal headers
response.body.must_equal body
end

it 'has cache-control methods' do
response = Rack::Response.new
cc = 'foo'
Expand Down

0 comments on commit 99d1da8

Please sign in to comment.