From d625eb2dbd5c085b9d8f4c8b4d4ef37b5f9cb3d4 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 23 Apr 2026 14:30:02 +0000 Subject: [PATCH] Rubocop: Style/FrozenStringLiteralComment --- .rubocop_todo.yml | 7 ------- config/initializers/new_framework_defaults_6_0.rb | 2 ++ ...ctive_storage_attachments_for_blob_id.active_storage.rb | 2 ++ db/migrate/20240101010101_add_fields_to_crops.rb | 2 ++ ...240101010102_populate_crop_fields_from_openfarm_data.rb | 2 ++ db/migrate/20240716120000_add_social_media_to_members.rb | 2 ++ ...16120001_rename_other_handle_to_other_url_in_members.rb | 2 ++ db/migrate/20240929041435_create_garden_collaborators.rb | 2 ++ ...129215300_create_australian_food_classification_data.rb | 2 ++ .../20250810120000_make_notifications_polymorphic.rb | 2 ++ db/migrate/20250824081313_change_comments_polymorphic.rb | 2 ++ db/migrate/20250901105232_add_source_to_seeds.rb | 2 ++ db/migrate/20250901110545_add_indexes_crops.rb | 2 ++ db/migrate/20250901130830_add_overall_rating_plantings.rb | 2 ++ db/migrate/20251128193317_add_en_youtube_url_to_crops.rb | 2 ++ db/migrate/20251130035700_create_versions.rb | 2 ++ .../20251130035701_add_object_changes_to_versions.rb | 2 ++ db/migrate/20251130053104_add_public_food_key_to_crops.rb | 2 ++ lib/tasks/import.rake | 2 ++ spec/factories/garden_collaborators.rb | 2 ++ .../activities/creating_a_recurring_activity_spec.rb | 2 ++ spec/lib/haml/filters/growstuff_markdown_spec.rb | 2 ++ spec/tasks/import_spec.rb | 2 ++ 23 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e700df88e..5778c363f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -734,13 +734,6 @@ Style/FloatDivision: Exclude: - 'app/models/concerns/predict_planting.rb' -# Offense count: 22 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Enabled: false - # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Style/GlobalStdStream: diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb index 92240ef5f..0c410fe9e 100644 --- a/config/initializers/new_framework_defaults_6_0.rb +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 6.0 upgrade. diff --git a/db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb b/db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb index 2a0973a97..e3cea4fc3 100644 --- a/db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb +++ b/db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20180723000244) class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] def up diff --git a/db/migrate/20240101010101_add_fields_to_crops.rb b/db/migrate/20240101010101_add_fields_to_crops.rb index 59cbcda90..b985ea94b 100644 --- a/db/migrate/20240101010101_add_fields_to_crops.rb +++ b/db/migrate/20240101010101_add_fields_to_crops.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFieldsToCrops < ActiveRecord::Migration[5.2] def change add_column :crops, :row_spacing, :integer diff --git a/db/migrate/20240101010102_populate_crop_fields_from_openfarm_data.rb b/db/migrate/20240101010102_populate_crop_fields_from_openfarm_data.rb index a9b699048..b63a93794 100644 --- a/db/migrate/20240101010102_populate_crop_fields_from_openfarm_data.rb +++ b/db/migrate/20240101010102_populate_crop_fields_from_openfarm_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PopulateCropFieldsFromOpenfarmData < ActiveRecord::Migration[5.2] def up Crop.find_each do |crop| diff --git a/db/migrate/20240716120000_add_social_media_to_members.rb b/db/migrate/20240716120000_add_social_media_to_members.rb index 1b7fc97ec..41679c809 100644 --- a/db/migrate/20240716120000_add_social_media_to_members.rb +++ b/db/migrate/20240716120000_add_social_media_to_members.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSocialMediaToMembers < ActiveRecord::Migration[6.0] def change add_column :members, :website_url, :string diff --git a/db/migrate/20240716120001_rename_other_handle_to_other_url_in_members.rb b/db/migrate/20240716120001_rename_other_handle_to_other_url_in_members.rb index e78eb12eb..5fd3b19be 100644 --- a/db/migrate/20240716120001_rename_other_handle_to_other_url_in_members.rb +++ b/db/migrate/20240716120001_rename_other_handle_to_other_url_in_members.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RenameOtherHandleToOtherUrlInMembers < ActiveRecord::Migration[6.0] def change rename_column :members, :other_handle, :other_url diff --git a/db/migrate/20240929041435_create_garden_collaborators.rb b/db/migrate/20240929041435_create_garden_collaborators.rb index 20b12f753..129603813 100644 --- a/db/migrate/20240929041435_create_garden_collaborators.rb +++ b/db/migrate/20240929041435_create_garden_collaborators.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateGardenCollaborators < ActiveRecord::Migration[7.2] def change create_table :garden_collaborators do |t| diff --git a/db/migrate/20241129215300_create_australian_food_classification_data.rb b/db/migrate/20241129215300_create_australian_food_classification_data.rb index ba3953974..4ceda087f 100644 --- a/db/migrate/20241129215300_create_australian_food_classification_data.rb +++ b/db/migrate/20241129215300_create_australian_food_classification_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAustralianFoodClassificationData < ActiveRecord::Migration[5.2] def change create_table :australian_food_classification_data do |t| diff --git a/db/migrate/20250810120000_make_notifications_polymorphic.rb b/db/migrate/20250810120000_make_notifications_polymorphic.rb index 0e38c98dc..fae766d58 100644 --- a/db/migrate/20250810120000_make_notifications_polymorphic.rb +++ b/db/migrate/20250810120000_make_notifications_polymorphic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MakeNotificationsPolymorphic < ActiveRecord::Migration[6.1] def change add_column :notifications, :notifiable_type, :string diff --git a/db/migrate/20250824081313_change_comments_polymorphic.rb b/db/migrate/20250824081313_change_comments_polymorphic.rb index 25ebf9019..a4ec6ed17 100644 --- a/db/migrate/20250824081313_change_comments_polymorphic.rb +++ b/db/migrate/20250824081313_change_comments_polymorphic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeCommentsPolymorphic < ActiveRecord::Migration[7.2] def change add_column :comments, :commentable_type, :string diff --git a/db/migrate/20250901105232_add_source_to_seeds.rb b/db/migrate/20250901105232_add_source_to_seeds.rb index 2fca4b203..9e5fa2140 100644 --- a/db/migrate/20250901105232_add_source_to_seeds.rb +++ b/db/migrate/20250901105232_add_source_to_seeds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSourceToSeeds < ActiveRecord::Migration[7.2] def change add_column :seeds, :source, :string diff --git a/db/migrate/20250901110545_add_indexes_crops.rb b/db/migrate/20250901110545_add_indexes_crops.rb index 0a519bb11..5520fc86a 100644 --- a/db/migrate/20250901110545_add_indexes_crops.rb +++ b/db/migrate/20250901110545_add_indexes_crops.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexesCrops < ActiveRecord::Migration[7.2] def change add_index :alternate_names, :crop_id diff --git a/db/migrate/20250901130830_add_overall_rating_plantings.rb b/db/migrate/20250901130830_add_overall_rating_plantings.rb index 92b487327..e677621cd 100644 --- a/db/migrate/20250901130830_add_overall_rating_plantings.rb +++ b/db/migrate/20250901130830_add_overall_rating_plantings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOverallRatingPlantings < ActiveRecord::Migration[7.2] def change add_column :plantings, :overall_rating, :integer diff --git a/db/migrate/20251128193317_add_en_youtube_url_to_crops.rb b/db/migrate/20251128193317_add_en_youtube_url_to_crops.rb index bd0cb8e40..0b403304e 100644 --- a/db/migrate/20251128193317_add_en_youtube_url_to_crops.rb +++ b/db/migrate/20251128193317_add_en_youtube_url_to_crops.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddEnYoutubeUrlToCrops < ActiveRecord::Migration[7.2] def change add_column :crops, :en_youtube_url, :string diff --git a/db/migrate/20251130035700_create_versions.rb b/db/migrate/20251130035700_create_versions.rb index e5489214f..7d2068340 100644 --- a/db/migrate/20251130035700_create_versions.rb +++ b/db/migrate/20251130035700_create_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration creates the `versions` table for the Version class. # All other migrations PT provides are optional. class CreateVersions < ActiveRecord::Migration[7.2] diff --git a/db/migrate/20251130035701_add_object_changes_to_versions.rb b/db/migrate/20251130035701_add_object_changes_to_versions.rb index 6628f1ad8..4e2c4f4c2 100644 --- a/db/migrate/20251130035701_add_object_changes_to_versions.rb +++ b/db/migrate/20251130035701_add_object_changes_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration adds the optional `object_changes` column, in which PaperTrail # will store the `changes` diff for each update event. See the readme for # details. diff --git a/db/migrate/20251130053104_add_public_food_key_to_crops.rb b/db/migrate/20251130053104_add_public_food_key_to_crops.rb index eac25c3dd..ddf4eccc9 100644 --- a/db/migrate/20251130053104_add_public_food_key_to_crops.rb +++ b/db/migrate/20251130053104_add_public_food_key_to_crops.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPublicFoodKeyToCrops < ActiveRecord::Migration[5.2] def change add_column :crops, :public_food_key, :string diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 57ead374c..3663d9d40 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'csv' namespace :import do diff --git a/spec/factories/garden_collaborators.rb b/spec/factories/garden_collaborators.rb index 20cabd2e9..e238ea082 100644 --- a/spec/factories/garden_collaborators.rb +++ b/spec/factories/garden_collaborators.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory :garden_collaborator do garden diff --git a/spec/features/activities/creating_a_recurring_activity_spec.rb b/spec/features/activities/creating_a_recurring_activity_spec.rb index 3400700cb..4ad835eea 100644 --- a/spec/features/activities/creating_a_recurring_activity_spec.rb +++ b/spec/features/activities/creating_a_recurring_activity_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' RSpec.feature 'Creating a recurring activity' do diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index 3087b3300..ecd211c6b 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' require 'haml/filters' require 'haml/filters/growstuff_markdown' diff --git a/spec/tasks/import_spec.rb b/spec/tasks/import_spec.rb index baad9e86a..b3945c786 100644 --- a/spec/tasks/import_spec.rb +++ b/spec/tasks/import_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' require 'rake'