From 0a5d24a0ce2aa8e48b51fd30dd4f796c103e3e03 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Tue, 28 Nov 2023 11:32:09 -0800 Subject: [PATCH] Change Style/FrozenStringLiteralComment cop to be enabled (#28) This branch changes rubocop to ensure there is a frozen literal string comment at the top of every ruby file. --- Rakefile | 2 ++ betterlint.gemspec | 4 +++- config/default.yml | 2 +- lib/rubocop/cop/betterment.rb | 2 ++ lib/rubocop/cop/betterment/active_job_performable.rb | 4 +++- lib/rubocop/cop/betterment/allowlist_blocklist.rb | 4 +++- lib/rubocop/cop/betterment/authorization_in_controller.rb | 4 +++- lib/rubocop/cop/betterment/dynamic_params.rb | 4 +++- lib/rubocop/cop/betterment/hardcoded_id.rb | 4 +++- lib/rubocop/cop/betterment/implicit_redirect_type.rb | 6 ++++-- lib/rubocop/cop/betterment/memoization_with_arguments.rb | 4 +++- lib/rubocop/cop/betterment/non_standard_actions.rb | 4 +++- lib/rubocop/cop/betterment/site_prism_loaded.rb | 4 +++- .../cop/betterment/spec_helper_required_outside_spec_dir.rb | 4 +++- lib/rubocop/cop/betterment/timeout.rb | 4 +++- lib/rubocop/cop/betterment/unsafe_job.rb | 4 +++- lib/rubocop/cop/betterment/unscoped_find.rb | 4 +++- lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb | 2 ++ lib/rubocop/cop/betterment/utils/method_return_table.rb | 2 ++ lib/rubocop/cop/betterment/utils/parser.rb | 2 ++ lib/rubocop/cop/betterment/vague_serialize.rb | 4 +++- spec/rubocop/cop/betterment/active_job_performable_spec.rb | 2 ++ spec/rubocop/cop/betterment/allowlist_blocklist_spec.rb | 2 ++ .../cop/betterment/authorization_in_controller_spec.rb | 4 +++- spec/rubocop/cop/betterment/dynamic_params_spec.rb | 4 +++- spec/rubocop/cop/betterment/hardcoded_id_spec.rb | 2 ++ spec/rubocop/cop/betterment/implicit_redirect_type_spec.rb | 2 ++ .../cop/betterment/memoization_with_arguments_spec.rb | 2 ++ spec/rubocop/cop/betterment/non_standard_actions_spec.rb | 2 ++ spec/rubocop/cop/betterment/server_error_assertion_spec.rb | 2 ++ spec/rubocop/cop/betterment/site_prism_loaded_spec.rb | 2 ++ .../spec_helper_required_outside_spec_dir_spec.rb | 2 ++ spec/rubocop/cop/betterment/timeout_spec.rb | 2 ++ spec/rubocop/cop/betterment/unsafe_job_spec.rb | 4 +++- spec/rubocop/cop/betterment/unscoped_find_spec.rb | 4 +++- .../cop/betterment/utils/hardcoded_attribute_spec.rb | 2 ++ .../cop/betterment/utils/method_return_table_spec.rb | 2 ++ spec/rubocop/cop/betterment/utils/parser_spec.rb | 2 ++ spec/rubocop/cop/betterment/vague_serialize_spec.rb | 2 ++ spec/spec_helper.rb | 2 ++ spec/support/betterlint_config.rb | 2 ++ 41 files changed, 101 insertions(+), 21 deletions(-) diff --git a/Rakefile b/Rakefile index a384ffe..b0a9082 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'bundler/setup' rescue LoadError diff --git a/betterlint.gemspec b/betterlint.gemspec index 4c3edb3..2886f8b 100644 --- a/betterlint.gemspec +++ b/betterlint.gemspec @@ -1,9 +1,11 @@ +# frozen_string_literal: true + lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |s| s.name = "betterlint" - s.version = "1.5.0" + s.version = "1.6.0" s.authors = ["Development"] s.email = ["development@betterment.com"] s.summary = "Betterment rubocop configuration" diff --git a/config/default.yml b/config/default.yml index ff54108..f1b8b3c 100644 --- a/config/default.yml +++ b/config/default.yml @@ -292,7 +292,7 @@ Style/Documentation: Enabled: false Style/FrozenStringLiteralComment: - Enabled: false + Enabled: true Style/GuardClause: Enabled: false diff --git a/lib/rubocop/cop/betterment.rb b/lib/rubocop/cop/betterment.rb index 0007d49..f22e156 100644 --- a/lib/rubocop/cop/betterment.rb +++ b/lib/rubocop/cop/betterment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubocop' require 'rubocop/cop/betterment/utils/parser' require 'rubocop/cop/betterment/utils/method_return_table' diff --git a/lib/rubocop/cop/betterment/active_job_performable.rb b/lib/rubocop/cop/betterment/active_job_performable.rb index fea58d0..cd82b8c 100644 --- a/lib/rubocop/cop/betterment/active_job_performable.rb +++ b/lib/rubocop/cop/betterment/active_job_performable.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class ActiveJobPerformable < Cop - MSG = <<~DOC.freeze + MSG = <<~DOC Classes that are "performable" should be ActiveJobs class MyJob < ApplicationJob diff --git a/lib/rubocop/cop/betterment/allowlist_blocklist.rb b/lib/rubocop/cop/betterment/allowlist_blocklist.rb index 2db6bcf..df43662 100644 --- a/lib/rubocop/cop/betterment/allowlist_blocklist.rb +++ b/lib/rubocop/cop/betterment/allowlist_blocklist.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + # rubocop:disable Betterment/AllowlistBlocklist module RuboCop module Cop module Betterment class AllowlistBlocklist < Cop - MSG = <<-DOC.freeze + MSG = <<-DOC Avoid usages of whitelist & blacklist, in favor of more inclusive and descriptive language. For consistency, favor 'allowlist' and 'blocklist' where possible, but other terms (such as denylist, ignorelist, warnlist, safelist, etc) may be appropriate, depending on the use case. diff --git a/lib/rubocop/cop/betterment/authorization_in_controller.rb b/lib/rubocop/cop/betterment/authorization_in_controller.rb index a4bf288..2d2fb0a 100644 --- a/lib/rubocop/cop/betterment/authorization_in_controller.rb +++ b/lib/rubocop/cop/betterment/authorization_in_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment @@ -5,7 +7,7 @@ class AuthorizationInController < Cop attr_accessor :unsafe_parameters, :unsafe_regex # MSG_UNSAFE_CREATE = 'Model created/updated using unsafe parameters'.freeze - MSG_UNSAFE_CREATE = <<~MSG.freeze + MSG_UNSAFE_CREATE = <<~MSG Model created/updated using unsafe parameters. Please query for the associated record in a way that enforces authorization (e.g. "trust-root chaining"), and then pass the resulting object into your model instead of the unsafe parameter. diff --git a/lib/rubocop/cop/betterment/dynamic_params.rb b/lib/rubocop/cop/betterment/dynamic_params.rb index 2f16859..e094f90 100644 --- a/lib/rubocop/cop/betterment/dynamic_params.rb +++ b/lib/rubocop/cop/betterment/dynamic_params.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class DynamicParams < Cop - MSG_DYNAMIC_PARAMS = <<~MSG.freeze + MSG_DYNAMIC_PARAMS = <<~MSG Parameter names accessed dynamically, cannot determine safeness. Please inline the keys explicitly when calling `permit` or when accessing `params` like a hash. See here for more information on this error: diff --git a/lib/rubocop/cop/betterment/hardcoded_id.rb b/lib/rubocop/cop/betterment/hardcoded_id.rb index 28b9c5a..b2b7d4c 100644 --- a/lib/rubocop/cop/betterment/hardcoded_id.rb +++ b/lib/rubocop/cop/betterment/hardcoded_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment @@ -5,7 +7,7 @@ class HardcodedID < Base include RangeHelp extend AutoCorrector - MSG = 'Hardcoded IDs cause flaky tests. Use a sequence instead.'.freeze + MSG = 'Hardcoded IDs cause flaky tests. Use a sequence instead.' # @!method key(node) def_node_matcher :key, '/^id$|_id$/' diff --git a/lib/rubocop/cop/betterment/implicit_redirect_type.rb b/lib/rubocop/cop/betterment/implicit_redirect_type.rb index bd61276..3ba2b6c 100644 --- a/lib/rubocop/cop/betterment/implicit_redirect_type.rb +++ b/lib/rubocop/cop/betterment/implicit_redirect_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment @@ -13,10 +15,10 @@ module Betterment # get '/', redirect('/dashboard', status: 301) # get(status: 302) { |params, request| '/dashboard' } class ImplicitRedirectType < Cop - ROUTES_FILE_NAME = 'routes.rb'.freeze + ROUTES_FILE_NAME = 'routes.rb' MSG = 'Rails will create a permanent (301) redirect, which is dangerous. ' \ - 'Please specify your desired status, e.g. redirect(..., status: 302)'.freeze + 'Please specify your desired status, e.g. redirect(..., status: 302)' # redirect('/') def_node_matcher :arg_form_without_options?, <<-PATTERN diff --git a/lib/rubocop/cop/betterment/memoization_with_arguments.rb b/lib/rubocop/cop/betterment/memoization_with_arguments.rb index e284946..271d5a0 100644 --- a/lib/rubocop/cop/betterment/memoization_with_arguments.rb +++ b/lib/rubocop/cop/betterment/memoization_with_arguments.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class MemoizationWithArguments < Cop MSG = 'Memoized method `%s` accepts arguments, ' \ 'which may cause it to return a stale result. ' \ - 'Remove memoization or refactor to remove arguments.'.freeze + 'Remove memoization or refactor to remove arguments.' def self.node_pattern memo_assign = '(or_asgn $(ivasgn _) _)' diff --git a/lib/rubocop/cop/betterment/non_standard_actions.rb b/lib/rubocop/cop/betterment/non_standard_actions.rb index c88d86f..35a71de 100644 --- a/lib/rubocop/cop/betterment/non_standard_actions.rb +++ b/lib/rubocop/cop/betterment/non_standard_actions.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class NonStandardActions < Cop - MSG_GENERAL = 'Use a new controller instead of custom actions.'.freeze + MSG_GENERAL = 'Use a new controller instead of custom actions.' MSG_RESOURCE_ONLY = "Resource route refers to a non-standard action in it's 'only:' param. #{MSG_GENERAL}".freeze MSG_ROUTE_TO = "Route goes to a non-standard controller action. #{MSG_GENERAL}".freeze diff --git a/lib/rubocop/cop/betterment/site_prism_loaded.rb b/lib/rubocop/cop/betterment/site_prism_loaded.rb index 4d4f317..3b98e12 100644 --- a/lib/rubocop/cop/betterment/site_prism_loaded.rb +++ b/lib/rubocop/cop/betterment/site_prism_loaded.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class SitePrismLoaded < Cop - MSG = 'Use `be_loaded` instead of `be_displayed`'.freeze + MSG = 'Use `be_loaded` instead of `be_displayed`' def_node_matcher :be_displayed_call?, <<-PATTERN (send (send nil? :expect _) _ (send nil? :be_displayed)) diff --git a/lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb b/lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb index acb7cb0..7c87afa 100644 --- a/lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb +++ b/lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment @@ -13,7 +15,7 @@ module Betterment # spec/models/my_class_spec.rb # require 'rails_helper' class SpecHelperRequiredOutsideSpecDir < Cop - MSG = 'Spec helper required outside of a spec/ directory.'.freeze + MSG = 'Spec helper required outside of a spec/ directory.' def_node_matcher :requires_spec_helper?, <<-PATTERN (send nil? :require diff --git a/lib/rubocop/cop/betterment/timeout.rb b/lib/rubocop/cop/betterment/timeout.rb index b48508d..038b440 100644 --- a/lib/rubocop/cop/betterment/timeout.rb +++ b/lib/rubocop/cop/betterment/timeout.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class Timeout < Cop - MSG = 'Using Timeout.timeout without a custom exception can prevent rescue blocks from executing'.freeze + MSG = 'Using Timeout.timeout without a custom exception can prevent rescue blocks from executing' def_node_matcher :timeout_call?, <<-PATTERN (send (const nil? :Timeout) :timeout _) diff --git a/lib/rubocop/cop/betterment/unsafe_job.rb b/lib/rubocop/cop/betterment/unsafe_job.rb index b0f8a77..f715ced 100644 --- a/lib/rubocop/cop/betterment/unsafe_job.rb +++ b/lib/rubocop/cop/betterment/unsafe_job.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class UnsafeJob < Cop attr_accessor :sensitive_params, :class_regex - MSG = <<~MSG.freeze + MSG = <<~MSG This job takes a parameter that will end up serialized in plaintext. Do not pass sensitive data as bare arguments into jobs. See here for more information on this error: diff --git a/lib/rubocop/cop/betterment/unscoped_find.rb b/lib/rubocop/cop/betterment/unscoped_find.rb index 812498b..302afbf 100644 --- a/lib/rubocop/cop/betterment/unscoped_find.rb +++ b/lib/rubocop/cop/betterment/unscoped_find.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class UnscopedFind < Cop attr_accessor :unauthenticated_models - MSG = <<~MSG.freeze + MSG = <<~MSG Records are being retrieved directly using user input. Please query for the associated record in a way that enforces authorization (e.g. "trust-root chaining"). diff --git a/lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb b/lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb index c24ab7e..2e414df 100644 --- a/lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb +++ b/lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment diff --git a/lib/rubocop/cop/betterment/utils/method_return_table.rb b/lib/rubocop/cop/betterment/utils/method_return_table.rb index 9a5d216..239be93 100644 --- a/lib/rubocop/cop/betterment/utils/method_return_table.rb +++ b/lib/rubocop/cop/betterment/utils/method_return_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment diff --git a/lib/rubocop/cop/betterment/utils/parser.rb b/lib/rubocop/cop/betterment/utils/parser.rb index 9da3938..b0f5673 100644 --- a/lib/rubocop/cop/betterment/utils/parser.rb +++ b/lib/rubocop/cop/betterment/utils/parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment diff --git a/lib/rubocop/cop/betterment/vague_serialize.rb b/lib/rubocop/cop/betterment/vague_serialize.rb index c86dbc6..7c5543e 100644 --- a/lib/rubocop/cop/betterment/vague_serialize.rb +++ b/lib/rubocop/cop/betterment/vague_serialize.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + module RuboCop module Cop module Betterment class VagueSerialize < Base MSG = 'Active Record models with serialized columns should specify which ' \ - 'deserializer to use instead of falling back to the default.'.freeze + 'deserializer to use instead of falling back to the default.' # @!method serialize?(node) def_node_matcher :serialize?, <<-PATTERN diff --git a/spec/rubocop/cop/betterment/active_job_performable_spec.rb b/spec/rubocop/cop/betterment/active_job_performable_spec.rb index 3a8cbc8..e92c6cf 100644 --- a/spec/rubocop/cop/betterment/active_job_performable_spec.rb +++ b/spec/rubocop/cop/betterment/active_job_performable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::ActiveJobPerformable, :config do diff --git a/spec/rubocop/cop/betterment/allowlist_blocklist_spec.rb b/spec/rubocop/cop/betterment/allowlist_blocklist_spec.rb index d941773..98fdb0f 100644 --- a/spec/rubocop/cop/betterment/allowlist_blocklist_spec.rb +++ b/spec/rubocop/cop/betterment/allowlist_blocklist_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::AllowlistBlocklist, :config do diff --git a/spec/rubocop/cop/betterment/authorization_in_controller_spec.rb b/spec/rubocop/cop/betterment/authorization_in_controller_spec.rb index c73f202..4b186b9 100644 --- a/spec/rubocop/cop/betterment/authorization_in_controller_spec.rb +++ b/spec/rubocop/cop/betterment/authorization_in_controller_spec.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::AuthorizationInController, :config do let(:offense_create) do - <<~MSG.freeze + <<~MSG Model created/updated using unsafe parameters. Please query for the associated record in a way that enforces authorization (e.g. "trust-root chaining"), and then pass the resulting object into your model instead of the unsafe parameter. diff --git a/spec/rubocop/cop/betterment/dynamic_params_spec.rb b/spec/rubocop/cop/betterment/dynamic_params_spec.rb index 37a2254..b3fb0d3 100644 --- a/spec/rubocop/cop/betterment/dynamic_params_spec.rb +++ b/spec/rubocop/cop/betterment/dynamic_params_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + describe RuboCop::Cop::Betterment::DynamicParams, :config do let(:offense_dynamic_parameter) do - <<~MSG.freeze + <<~MSG Parameter names accessed dynamically, cannot determine safeness. Please inline the keys explicitly when calling `permit` or when accessing `params` like a hash. See here for more information on this error: diff --git a/spec/rubocop/cop/betterment/hardcoded_id_spec.rb b/spec/rubocop/cop/betterment/hardcoded_id_spec.rb index 1ee9405..0c55b0a 100644 --- a/spec/rubocop/cop/betterment/hardcoded_id_spec.rb +++ b/spec/rubocop/cop/betterment/hardcoded_id_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::HardcodedID, :config do diff --git a/spec/rubocop/cop/betterment/implicit_redirect_type_spec.rb b/spec/rubocop/cop/betterment/implicit_redirect_type_spec.rb index 2c86944..6227d62 100644 --- a/spec/rubocop/cop/betterment/implicit_redirect_type_spec.rb +++ b/spec/rubocop/cop/betterment/implicit_redirect_type_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe RuboCop::Cop::Betterment::ImplicitRedirectType, :config do diff --git a/spec/rubocop/cop/betterment/memoization_with_arguments_spec.rb b/spec/rubocop/cop/betterment/memoization_with_arguments_spec.rb index 497aa65..e7b9b88 100644 --- a/spec/rubocop/cop/betterment/memoization_with_arguments_spec.rb +++ b/spec/rubocop/cop/betterment/memoization_with_arguments_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::MemoizationWithArguments, :config do diff --git a/spec/rubocop/cop/betterment/non_standard_actions_spec.rb b/spec/rubocop/cop/betterment/non_standard_actions_spec.rb index ca2cc9d..5d0e473 100644 --- a/spec/rubocop/cop/betterment/non_standard_actions_spec.rb +++ b/spec/rubocop/cop/betterment/non_standard_actions_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::NonStandardActions, :betterlint_config do diff --git a/spec/rubocop/cop/betterment/server_error_assertion_spec.rb b/spec/rubocop/cop/betterment/server_error_assertion_spec.rb index 8f4c90e..d23b7fd 100644 --- a/spec/rubocop/cop/betterment/server_error_assertion_spec.rb +++ b/spec/rubocop/cop/betterment/server_error_assertion_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::ServerErrorAssertion, :config do diff --git a/spec/rubocop/cop/betterment/site_prism_loaded_spec.rb b/spec/rubocop/cop/betterment/site_prism_loaded_spec.rb index 6e94d0e..e370d76 100644 --- a/spec/rubocop/cop/betterment/site_prism_loaded_spec.rb +++ b/spec/rubocop/cop/betterment/site_prism_loaded_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::SitePrismLoaded, :config do diff --git a/spec/rubocop/cop/betterment/spec_helper_required_outside_spec_dir_spec.rb b/spec/rubocop/cop/betterment/spec_helper_required_outside_spec_dir_spec.rb index dab9c58..003d56d 100644 --- a/spec/rubocop/cop/betterment/spec_helper_required_outside_spec_dir_spec.rb +++ b/spec/rubocop/cop/betterment/spec_helper_required_outside_spec_dir_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe RuboCop::Cop::Betterment::SpecHelperRequiredOutsideSpecDir, :config do diff --git a/spec/rubocop/cop/betterment/timeout_spec.rb b/spec/rubocop/cop/betterment/timeout_spec.rb index 306f6ce..4a8267c 100644 --- a/spec/rubocop/cop/betterment/timeout_spec.rb +++ b/spec/rubocop/cop/betterment/timeout_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::Timeout, :config do diff --git a/spec/rubocop/cop/betterment/unsafe_job_spec.rb b/spec/rubocop/cop/betterment/unsafe_job_spec.rb index 6a76a8a..a681a62 100644 --- a/spec/rubocop/cop/betterment/unsafe_job_spec.rb +++ b/spec/rubocop/cop/betterment/unsafe_job_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + describe RuboCop::Cop::Betterment::UnsafeJob, :config do let(:offense_unsafe_job) do - <<~MSG.freeze + <<~MSG This job takes a parameter that will end up serialized in plaintext. Do not pass sensitive data as bare arguments into jobs. See here for more information on this error: diff --git a/spec/rubocop/cop/betterment/unscoped_find_spec.rb b/spec/rubocop/cop/betterment/unscoped_find_spec.rb index 4f9847d..97047a4 100644 --- a/spec/rubocop/cop/betterment/unscoped_find_spec.rb +++ b/spec/rubocop/cop/betterment/unscoped_find_spec.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::UnscopedFind, :config do let(:offense_unscoped_find) do - <<~MSG.freeze + <<~MSG Records are being retrieved directly using user input. Please query for the associated record in a way that enforces authorization (e.g. "trust-root chaining"). diff --git a/spec/rubocop/cop/betterment/utils/hardcoded_attribute_spec.rb b/spec/rubocop/cop/betterment/utils/hardcoded_attribute_spec.rb index 22cf274..8ab06e8 100644 --- a/spec/rubocop/cop/betterment/utils/hardcoded_attribute_spec.rb +++ b/spec/rubocop/cop/betterment/utils/hardcoded_attribute_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::Utils::HardcodedAttribute do diff --git a/spec/rubocop/cop/betterment/utils/method_return_table_spec.rb b/spec/rubocop/cop/betterment/utils/method_return_table_spec.rb index bebe3c0..8f436aa 100644 --- a/spec/rubocop/cop/betterment/utils/method_return_table_spec.rb +++ b/spec/rubocop/cop/betterment/utils/method_return_table_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::Utils::MethodReturnTable do diff --git a/spec/rubocop/cop/betterment/utils/parser_spec.rb b/spec/rubocop/cop/betterment/utils/parser_spec.rb index 5675bd4..2ec6134 100644 --- a/spec/rubocop/cop/betterment/utils/parser_spec.rb +++ b/spec/rubocop/cop/betterment/utils/parser_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::Utils::Parser do diff --git a/spec/rubocop/cop/betterment/vague_serialize_spec.rb b/spec/rubocop/cop/betterment/vague_serialize_spec.rb index ec6c303..9e32cc9 100644 --- a/spec/rubocop/cop/betterment/vague_serialize_spec.rb +++ b/spec/rubocop/cop/betterment/vague_serialize_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe RuboCop::Cop::Betterment::VagueSerialize, :config do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5f311bd..9257147 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubocop' require 'rubocop/cop/betterment' require 'rubocop/rspec/support' diff --git a/spec/support/betterlint_config.rb b/spec/support/betterlint_config.rb index 6a11482..55492fe 100644 --- a/spec/support/betterlint_config.rb +++ b/spec/support/betterlint_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + BETTERLINT_CONFIG_PATH = File.expand_path('../../config/default.yml', __dir__) RSpec.shared_context 'betterlint_config', :betterlint_config do