Skip to content

Commit

Permalink
Run rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei committed Mar 31, 2024
1 parent 4007dd1 commit d220ef8
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/images/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Actions
module Images
class Show < HanamiTest::Action
def handle(_request, response)
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='.
unpack('m').first
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='
.unpack('m').first

Check notice

Code scanning / Rubocop

Checks for accessing the first element of `String#unpack` instead of using `unpack1`. Note test

Style/UnpackFirst: Use unpack1('m') instead of unpack('m').first.

response.format = :png
response.body = png
Expand Down
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/images/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Upload < HanamiTest::Action
# format :form

def handle(_request, response)
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='.
unpack('m').first
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='
.unpack('m').first

Check notice

Code scanning / Rubocop

Checks for accessing the first element of `String#unpack` instead of using `unpack1`. Note test

Style/UnpackFirst: Use unpack1('m') instead of unpack('m').first.

response.format = :png
response.body = png
Expand Down
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/images/upload_multiple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class UploadMultiple < HanamiTest::Action
# format :multipart

def handle(_request, response)
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='.
unpack('m').first
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='
.unpack('m').first

Check notice

Code scanning / Rubocop

Checks for accessing the first element of `String#unpack` instead of using `unpack1`. Note test

Style/UnpackFirst: Use unpack1('m') instead of unpack('m').first.

response.format = :png
response.body = png
Expand Down
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/images/upload_multiple_nested.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Actions
module Images
class UploadMultipleNested < HanamiTest::Action
def handle(_request, response)
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='.
unpack('m').first
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='
.unpack('m').first

Check notice

Code scanning / Rubocop

Checks for accessing the first element of `String#unpack` instead of using `unpack1`. Note test

Style/UnpackFirst: Use unpack1('m') instead of unpack('m').first.

response.format = :png
response.body = png
Expand Down
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/images/upload_nested.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Actions
module Images
class UploadNested < HanamiTest::Action
def handle(_request, response)
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='.
unpack('m').first
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjPQBoAAAAASUVORK5CYII='
.unpack('m').first

response.format = :png
response.body = png
Expand Down
4 changes: 2 additions & 2 deletions spec/apps/hanami/app/actions/users/user_repository.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module HanamiTest

Check notice

Code scanning / Rubocop

Checks style of children classes and modules. Note test

Style/ClassAndModuleChildren: Use compact module/class definition instead of nested style.
module Actions
module Users
Expand All @@ -20,8 +21,7 @@ def find_user(id = nil)
},
}
when '2'
{
}
{}
else
raise RecordNotFound
end
Expand Down
1 change: 0 additions & 1 deletion spec/apps/hanami/config/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "hanami"

module HanamiTest

class App < Hanami::App
config.middleware.use :body_parser, :json
end
Expand Down
3 changes: 1 addition & 2 deletions spec/apps/rails/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def find_user(id = nil)
},
}
when '2'
{
}
{}
else
raise NotFoundError
end
Expand Down
2 changes: 1 addition & 1 deletion spec/apps/rails/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
config.log_level = :debug

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Expand Down
2 changes: 1 addition & 1 deletion spec/apps/rails/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
post 'upload_multiple_nested'
end
end
resources :users, only: [:show, :create] do
resources :users, only: [:show, :create] do
get 'active'
end

Expand Down
2 changes: 1 addition & 1 deletion spec/requests/hanami_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,4 @@
expect(last_response.status).to eq(200)
end
end
end
end

0 comments on commit d220ef8

Please sign in to comment.