From 551cce263f5c8192d39fb4284519b2566739ae4f Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 3 Dec 2023 21:13:31 +0000 Subject: [PATCH 1/3] chore: rubocop lint --- .../passkeys/controllers/passkeys_controller_concern.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/devise/passkeys/controllers/passkeys_controller_concern.rb b/lib/devise/passkeys/controllers/passkeys_controller_concern.rb index 5a38dca..4ecb88b 100644 --- a/lib/devise/passkeys/controllers/passkeys_controller_concern.rb +++ b/lib/devise/passkeys/controllers/passkeys_controller_concern.rb @@ -94,9 +94,9 @@ def user_details_for_registration end def verify_credential_integrity - return render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil? + render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil? rescue JSON::JSONError, TypeError - return render_credential_missing_or_could_not_be_parsed_error + render_credential_missing_or_could_not_be_parsed_error end def verify_passkey_challenge @@ -137,7 +137,8 @@ def reauthentication_params def render_credential_missing_or_could_not_be_parsed_error render json: { message: find_message(:credential_missing_or_could_not_be_parsed) }, status: :bad_request delete_registration_challenge - return false + + false end end end From 078db4c1a6af74ebc565ee3f9021fe9523b1e583 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 3 Dec 2023 21:13:42 +0000 Subject: [PATCH 2/3] chore: typo --- .../passkeys/controllers/reauthentication_controller_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/devise/passkeys/controllers/reauthentication_controller_concern.rb b/lib/devise/passkeys/controllers/reauthentication_controller_concern.rb index 10fbe59..6f3c3a7 100644 --- a/lib/devise/passkeys/controllers/reauthentication_controller_concern.rb +++ b/lib/devise/passkeys/controllers/reauthentication_controller_concern.rb @@ -116,7 +116,7 @@ def prepare_params end # @!visibility public - # A method that can be overridden to customize the Warden stratey used. + # A method that can be overridden to customize the Warden strategy used. # @return [Symbol] The key that identifies which `Warden` strategy will be used to handle the # authentication flow for the reauthentication. Defaults to `:passkey_reauthentication` def strategy From 28b74460f220ac0d7e76b148f7025f0bb55e8292 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 3 Dec 2023 21:19:52 +0000 Subject: [PATCH 3/3] chore: rubocop lint fixes --- Gemfile | 4 ++-- gemfiles/rails_6.gemfile | 4 +++- gemfiles/rails_7.gemfile | 4 +++- test/test_helper/extra_assertions.rb | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index a702e1e..2238cac 100644 --- a/Gemfile +++ b/Gemfile @@ -10,8 +10,8 @@ group :development, :test do gem "debug" gem "rake", "~> 13.0" gem "rubocop", "~> 1.21" - gem 'yard' - gem 'webrick' + gem "webrick" + gem "yard" end group :test do diff --git a/gemfiles/rails_6.gemfile b/gemfiles/rails_6.gemfile index 0f683e3..c3db0d1 100644 --- a/gemfiles/rails_6.gemfile +++ b/gemfiles/rails_6.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" @@ -10,8 +12,8 @@ group :development, :test do gem "debug" gem "rake", "~> 13.0" gem "rubocop", "~> 1.21" - gem "yard" gem "webrick" + gem "yard" end group :test do diff --git a/gemfiles/rails_7.gemfile b/gemfiles/rails_7.gemfile index 9f2f663..24542f2 100644 --- a/gemfiles/rails_7.gemfile +++ b/gemfiles/rails_7.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" @@ -10,8 +12,8 @@ group :development, :test do gem "debug" gem "rake", "~> 13.0" gem "rubocop", "~> 1.21" - gem "yard" gem "webrick" + gem "yard" end group :test do diff --git a/test/test_helper/extra_assertions.rb b/test/test_helper/extra_assertions.rb index e1729b4..8de3640 100644 --- a/test/test_helper/extra_assertions.rb +++ b/test/test_helper/extra_assertions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ExtraAssertions def assert_translation_missing_message(translation_key:) assert_translation_missing(translation_key: translation_key, field: "message") @@ -9,7 +11,7 @@ def assert_translation_missing_error(translation_key:) def assert_translation_missing(translation_key:, field:) assert_equal [field], response.parsed_body.keys - assert_match /^translation missing/i, response.parsed_body[field] + assert_match(/^translation missing/i, response.parsed_body[field]) assert_equal true, response.parsed_body[field].include?(translation_key) end end