Skip to content

Commit 2985ac0

Browse files
Merge pull request #52 from MatthewKennedy/lint-rubocop
Basic Rubocop Lint fixes
2 parents 6940cc5 + 28b7446 commit 2985ac0

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ group :development, :test do
1010
gem "debug"
1111
gem "rake", "~> 13.0"
1212
gem "rubocop", "~> 1.21"
13-
gem 'yard'
14-
gem 'webrick'
13+
gem "webrick"
14+
gem "yard"
1515
end
1616

1717
group :test do

gemfiles/rails_6.gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This file was generated by Appraisal
24

35
source "https://rubygems.org"
@@ -10,8 +12,8 @@ group :development, :test do
1012
gem "debug"
1113
gem "rake", "~> 13.0"
1214
gem "rubocop", "~> 1.21"
13-
gem "yard"
1415
gem "webrick"
16+
gem "yard"
1517
end
1618

1719
group :test do

gemfiles/rails_7.gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This file was generated by Appraisal
24

35
source "https://rubygems.org"
@@ -10,8 +12,8 @@ group :development, :test do
1012
gem "debug"
1113
gem "rake", "~> 13.0"
1214
gem "rubocop", "~> 1.21"
13-
gem "yard"
1415
gem "webrick"
16+
gem "yard"
1517
end
1618

1719
group :test do

lib/devise/passkeys/controllers/passkeys_controller_concern.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ def user_details_for_registration
9494
end
9595

9696
def verify_credential_integrity
97-
return render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil?
97+
render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil?
9898
rescue JSON::JSONError, TypeError
99-
return render_credential_missing_or_could_not_be_parsed_error
99+
render_credential_missing_or_could_not_be_parsed_error
100100
end
101101

102102
def verify_passkey_challenge
@@ -137,7 +137,8 @@ def reauthentication_params
137137
def render_credential_missing_or_could_not_be_parsed_error
138138
render json: { message: find_message(:credential_missing_or_could_not_be_parsed) }, status: :bad_request
139139
delete_registration_challenge
140-
return false
140+
141+
false
141142
end
142143
end
143144
end

lib/devise/passkeys/controllers/reauthentication_controller_concern.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def prepare_params
116116
end
117117

118118
# @!visibility public
119-
# A method that can be overridden to customize the Warden stratey used.
119+
# A method that can be overridden to customize the Warden strategy used.
120120
# @return [Symbol] The key that identifies which `Warden` strategy will be used to handle the
121121
# authentication flow for the reauthentication. Defaults to `:passkey_reauthentication`
122122
def strategy

test/test_helper/extra_assertions.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ExtraAssertions
24
def assert_translation_missing_message(translation_key:)
35
assert_translation_missing(translation_key: translation_key, field: "message")
@@ -9,7 +11,7 @@ def assert_translation_missing_error(translation_key:)
911

1012
def assert_translation_missing(translation_key:, field:)
1113
assert_equal [field], response.parsed_body.keys
12-
assert_match /^translation missing/i, response.parsed_body[field]
14+
assert_match(/^translation missing/i, response.parsed_body[field])
1315
assert_equal true, response.parsed_body[field].include?(translation_key)
1416
end
1517
end

0 commit comments

Comments
 (0)