diff --git a/.rubocop.yml b/.rubocop.yml index bd63241dbf5..0a7050abfa4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -480,6 +480,12 @@ Lint/RaiseException: Lint/RandOne: Enabled: true +Lint/RedundantCopDisableDirective: + Enabled: true + +Lint/RedundantCopEnableDirective: + Enabled: true + Lint/RedundantRequireStatement: Enabled: true diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb index e28921f95e8..666a7629468 100644 --- a/app/helpers/form_helper.rb +++ b/app/helpers/form_helper.rb @@ -1,5 +1,4 @@ module FormHelper - # rubocop:disable Style/WordArray # This method is single statement spread across many lines for readability def us_states_territories [ @@ -65,7 +64,6 @@ def us_states_territories ['Wyoming', 'WY'], ] end - # rubocop:enable Style/WordArray private diff --git a/app/services/attribute_asserter.rb b/app/services/attribute_asserter.rb index 989697365f3..d5b87514c80 100644 --- a/app/services/attribute_asserter.rb +++ b/app/services/attribute_asserter.rb @@ -30,7 +30,6 @@ def initialize(user:, self.user_session = user_session end - # rubocop:disable Metrics/PerceivedComplexity def build attrs = default_attrs add_email(attrs) if bundle.include? :email @@ -42,7 +41,6 @@ def build add_x509(attrs) if bundle.include?(:x509_presented) && x509_data user.asserted_attributes = attrs end - # rubocop:enable Metrics/PerceivedComplexity private diff --git a/app/services/doc_auth/error_generator.rb b/app/services/doc_auth/error_generator.rb index cab8433524b..639d32820d6 100644 --- a/app/services/doc_auth/error_generator.rb +++ b/app/services/doc_auth/error_generator.rb @@ -49,7 +49,6 @@ def initialize(config) 'Visible Photo Characteristics': { type: FRONT, msg_key: Errors::VISIBLE_PHOTO_CHECK }, }.freeze - # rubocop:disable Metrics/PerceivedComplexity def generate_doc_auth_errors(response_info) liveness_enabled = response_info[:liveness_enabled] alert_error_count = response_info[:alert_failure_count] @@ -95,8 +94,6 @@ def generate_doc_auth_errors(response_info) errors.transform_values(&:to_a) end - # rubocop:enable Metrics/PerceivedComplexity - # private def get_image_metric_errors(processed_image_metrics) diff --git a/app/services/doc_auth/mock/doc_auth_mock_client.rb b/app/services/doc_auth/mock/doc_auth_mock_client.rb index 8a22e0fb54e..f328cb70b45 100644 --- a/app/services/doc_auth/mock/doc_auth_mock_client.rb +++ b/app/services/doc_auth/mock/doc_auth_mock_client.rb @@ -1,4 +1,3 @@ -# rubocop:disable Lint/UnusedMethodArgument module DocAuth module Mock class DocAuthMockClient @@ -124,4 +123,3 @@ def mocked_response_for_method(method_name) end end end -# rubocop:enable Lint/UnusedMethodArgument diff --git a/app/services/encryption/multi_region_kms_client.rb b/app/services/encryption/multi_region_kms_client.rb index ef2528f06a7..9b6ef33ceb3 100644 --- a/app/services/encryption/multi_region_kms_client.rb +++ b/app/services/encryption/multi_region_kms_client.rb @@ -98,7 +98,7 @@ def resolve_decryption(ciphertext) # checking if it looks like the JSON hash we want if ciphertext.start_with?('{"regions"') parsed_payload = JSON.parse(ciphertext) - if parsed_payload.is_a?(Hash) # rubocop:disable Style/GuardClause + if parsed_payload.is_a?(Hash) regions = parsed_payload['regions'] resolve_region_decryption(regions) else diff --git a/lib/telephony/pinpoint/sms_sender.rb b/lib/telephony/pinpoint/sms_sender.rb index d92861ac95f..ca01e3a44ad 100644 --- a/lib/telephony/pinpoint/sms_sender.rb +++ b/lib/telephony/pinpoint/sms_sender.rb @@ -147,7 +147,6 @@ def build_response(pinpoint_response, start:, finish:) }, ) end - # rubocop:enable Metrics/MethodLength def success?(message_response_result) message_response_result.delivery_status == 'SUCCESSFUL' diff --git a/spec/features/idv/doc_auth/verify_step_spec.rb b/spec/features/idv/doc_auth/verify_step_spec.rb index f768219de5b..cb36e68c09a 100644 --- a/spec/features/idv/doc_auth/verify_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_step_spec.rb @@ -165,14 +165,11 @@ success: true, errors: {}, context: { stages: [] }, ) - # rubocop:disable Layout/LineLength stub_const( 'Idv::Steps::VerifyBaseStep::AAMVA_SUPPORTED_JURISDICTIONS', Idv::Steps::VerifyBaseStep::AAMVA_SUPPORTED_JURISDICTIONS + [DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC[:state_id_jurisdiction]], ) - # rubocop:enable Layout/LineLength - sign_in_and_2fa_user complete_doc_auth_steps_before_verify_step click_idv_continue @@ -195,14 +192,11 @@ success: true, errors: {}, context: { stages: [] }, ) - # rubocop:disable Layout/LineLength stub_const( 'Idv::Steps::VerifyBaseStep::AAMVA_SUPPORTED_JURISDICTIONS', Idv::Steps::VerifyBaseStep::AAMVA_SUPPORTED_JURISDICTIONS - [DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC[:state_id_jurisdiction]], ) - # rubocop:enable Layout/LineLength - sign_in_and_2fa_user complete_doc_auth_steps_before_verify_step click_idv_continue diff --git a/spec/services/proofing/base_spec.rb b/spec/services/proofing/base_spec.rb index b1bd9657ed8..eba20a37924 100644 --- a/spec/services/proofing/base_spec.rb +++ b/spec/services/proofing/base_spec.rb @@ -273,13 +273,10 @@ def hello(applicant, results) subject { impl.new.proof(applicant) } it 'does not affect the other proofer' do - # rubocop:disable Lint/UselessAssignment # This is an explicit check for class-level side effects impl2 = Class.new(Proofing::Base) do required_attributes :foobarbaz end - # rubocop:enable Lint/UselessAssignment - expect(subject.exception?).to eq(false) expect(subject.failed?).to eq(false) expect(subject.success?).to eq(true) diff --git a/spec/support/acuant_fixtures.rb b/spec/support/acuant_fixtures.rb index 8deba63346f..a3a9fb47616 100644 --- a/spec/support/acuant_fixtures.rb +++ b/spec/support/acuant_fixtures.rb @@ -1,4 +1,3 @@ -# rubocop:disable Naming/AccessorMethodName module AcuantFixtures def self.create_document_response load_response_fixture('create_document_response.json') @@ -45,4 +44,3 @@ def self.load_response_fixture(filename) File.read(path) end end -# rubocop:enable Naming/AccessorMethodName