diff --git a/.rubocop.yml b/.rubocop.yml index f6bf40684..c1a991fc6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -25,6 +25,7 @@ AllCops: - gemfiles/vendor/bundle/**/* - vendor/bundle/**/* - Guardfile + - test/dummy/**/* - vendor/**/* Layout/LineLength: @@ -97,9 +98,6 @@ Style/DoubleNegation: Style/EmptyMethod: Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false - Style/NumericPredicate: Enabled: false @@ -108,3 +106,18 @@ Style/StringLiterals: Style/TrivialAccessors: AllowPredicates: true + +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always # or 'always' or 'never' depending on your preference + SafeAutoCorrect: true # Set to true for safe autocorrection, false if you need to review changes + Exclude: + - ./**/Gemfile* + - bootstrap_form.gemspec + - Dangerfile + - demo/config/**/* + - demo/config.ru + - demo/db/migrate/**/* + - gemfiles/* + - Rakefile + - Vagrantfile diff --git a/.yarnrc b/.yarnrc index 9f4ac467c..319bc7507 100644 --- a/.yarnrc +++ b/.yarnrc @@ -2,4 +2,4 @@ # yarn lockfile v1 -lastUpdateCheck 1762373771610 +lastUpdateCheck 1762552807228 diff --git a/demo/app/controllers/application_controller.rb b/demo/app/controllers/application_controller.rb index 09705d12a..7944f9f99 100644 --- a/demo/app/controllers/application_controller.rb +++ b/demo/app/controllers/application_controller.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base end diff --git a/demo/app/controllers/bootstrap_controller.rb b/demo/app/controllers/bootstrap_controller.rb index b1e7dc37d..6af91cd6e 100644 --- a/demo/app/controllers/bootstrap_controller.rb +++ b/demo/app/controllers/bootstrap_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BootstrapController < ApplicationController def form load_models diff --git a/demo/app/controllers/users_controller.rb b/demo/app/controllers/users_controller.rb index ad7ddffdc..045d504e7 100644 --- a/demo/app/controllers/users_controller.rb +++ b/demo/app/controllers/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UsersController < ApplicationController def create redirect_to root_path diff --git a/demo/app/helpers/bootstrap_helper.rb b/demo/app/helpers/bootstrap_helper.rb index b28a0573d..d79a19e0b 100644 --- a/demo/app/helpers/bootstrap_helper.rb +++ b/demo/app/helpers/bootstrap_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BootstrapHelper def form_with_source(&) form_html = capture(&) diff --git a/demo/app/models/address.rb b/demo/app/models/address.rb index 003db314a..f8bcc1258 100644 --- a/demo/app/models/address.rb +++ b/demo/app/models/address.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Address < ApplicationRecord belongs_to :user diff --git a/demo/app/models/application_record.rb b/demo/app/models/application_record.rb index 10a4cba84..71fbba5b3 100644 --- a/demo/app/models/application_record.rb +++ b/demo/app/models/application_record.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end diff --git a/demo/app/models/faux_user.rb b/demo/app/models/faux_user.rb index d6485a3ff..4dbc9f81a 100644 --- a/demo/app/models/faux_user.rb +++ b/demo/app/models/faux_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FauxUser attr_accessor :email, :password, :comments, :misc diff --git a/demo/app/models/model_user.rb b/demo/app/models/model_user.rb index 654ec7135..055c27e4e 100644 --- a/demo/app/models/model_user.rb +++ b/demo/app/models/model_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ModelUser include ActiveModel::Model diff --git a/demo/app/models/skill.rb b/demo/app/models/skill.rb index 3430fcc62..a207636f7 100644 --- a/demo/app/models/skill.rb +++ b/demo/app/models/skill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Skill attr_accessor :id, :name diff --git a/demo/app/models/super_user.rb b/demo/app/models/super_user.rb index 96e8d1da7..b0c909cd8 100644 --- a/demo/app/models/super_user.rb +++ b/demo/app/models/super_user.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class SuperUser < User end diff --git a/demo/app/models/user.rb b/demo/app/models/user.rb index 52ea3a4a3..4f90da7f0 100644 --- a/demo/app/models/user.rb +++ b/demo/app/models/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class User < ApplicationRecord attr_accessor :remember_me diff --git a/demo/test/application_system_test_case.rb b/demo/test/application_system_test_case.rb index 5f91c1798..defa16c3e 100644 --- a/demo/test/application_system_test_case.rb +++ b/demo/test/application_system_test_case.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" require "capybara_screenshot_diff/minitest" diff --git a/demo/test/controllers/bootstrap_controller_test.rb b/demo/test/controllers/bootstrap_controller_test.rb index 576154662..57e163b92 100644 --- a/demo/test/controllers/bootstrap_controller_test.rb +++ b/demo/test/controllers/bootstrap_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class BootstrapControllerTest < ActionDispatch::IntegrationTest diff --git a/demo/test/controllers/users_controller_test.rb b/demo/test/controllers/users_controller_test.rb index 8ed69e4bd..e27dbfff2 100644 --- a/demo/test/controllers/users_controller_test.rb +++ b/demo/test/controllers/users_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UsersControllerTest < ActionDispatch::IntegrationTest diff --git a/demo/test/system/bootstrap_test.rb b/demo/test/system/bootstrap_test.rb index 811e0eec2..b55681ff0 100644 --- a/demo/test/system/bootstrap_test.rb +++ b/demo/test/system/bootstrap_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "application_system_test_case" require "capybara_screenshot_diff/minitest" diff --git a/lib/bootstrap_form.rb b/lib/bootstrap_form.rb index 61cc6066f..b7315ec97 100644 --- a/lib/bootstrap_form.rb +++ b/lib/bootstrap_form.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "action_view" require "action_pack" require "bootstrap_form/action_view_extensions/form_helper" diff --git a/lib/bootstrap_form/form_builder.rb b/lib/bootstrap_form/form_builder.rb index e866c8551..a3dab4b1b 100644 --- a/lib/bootstrap_form/form_builder.rb +++ b/lib/bootstrap_form/form_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # require 'bootstrap_form/aliasing' module BootstrapForm diff --git a/lib/bootstrap_form/helpers/bootstrap.rb b/lib/bootstrap_form/helpers/bootstrap.rb index 3ed6bf13c..2048c4485 100644 --- a/lib/bootstrap_form/helpers/bootstrap.rb +++ b/lib/bootstrap_form/helpers/bootstrap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BootstrapForm module Helpers module Bootstrap diff --git a/lib/bootstrap_form/helpers/field.rb b/lib/bootstrap_form/helpers/field.rb index fa007605f..7345e5ac4 100644 --- a/lib/bootstrap_form/helpers/field.rb +++ b/lib/bootstrap_form/helpers/field.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BootstrapForm module Helpers module Field diff --git a/lib/bootstrap_form/inputs/inputs_collection.rb b/lib/bootstrap_form/inputs/inputs_collection.rb index 4db529a6b..a8e1a6c0e 100644 --- a/lib/bootstrap_form/inputs/inputs_collection.rb +++ b/lib/bootstrap_form/inputs/inputs_collection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BootstrapForm module Inputs module InputsCollection diff --git a/lib/bootstrap_form/inputs/submit.rb b/lib/bootstrap_form/inputs/submit.rb index cddad6636..24c196d2a 100644 --- a/lib/bootstrap_form/inputs/submit.rb +++ b/lib/bootstrap_form/inputs/submit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BootstrapForm module Inputs module Submit diff --git a/lib/bootstrap_form/version.rb b/lib/bootstrap_form/version.rb index 44f7a61f8..efff9ee4c 100644 --- a/lib/bootstrap_form/version.rb +++ b/lib/bootstrap_form/version.rb @@ -1,4 +1,6 @@ +# frozen_string_literal: true + module BootstrapForm - VERSION = "5.5.0".freeze - REQUIRED_RAILS_VERSION = ">= 7.2".freeze + VERSION = "5.5.0" + REQUIRED_RAILS_VERSION = ">= 7.2" end diff --git a/test/bootstrap_checkbox_test.rb b/test/bootstrap_checkbox_test.rb index e026b653e..3eb9fc76d 100644 --- a/test/bootstrap_checkbox_test.rb +++ b/test/bootstrap_checkbox_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapCheckboxTest < ActionView::TestCase diff --git a/test/bootstrap_configuration_test.rb b/test/bootstrap_configuration_test.rb index ba1a37f74..9987f0396 100644 --- a/test/bootstrap_configuration_test.rb +++ b/test/bootstrap_configuration_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapConfigurationTest < ActionView::TestCase diff --git a/test/bootstrap_fields_for_test.rb b/test/bootstrap_fields_for_test.rb index 9e9e8ea50..eedcef366 100644 --- a/test/bootstrap_fields_for_test.rb +++ b/test/bootstrap_fields_for_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapFieldsForTest < ActionView::TestCase diff --git a/test/bootstrap_fields_test.rb b/test/bootstrap_fields_test.rb index b3e5117dd..e456c9924 100644 --- a/test/bootstrap_fields_test.rb +++ b/test/bootstrap_fields_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapFieldsTest < ActionView::TestCase diff --git a/test/bootstrap_form_group_test.rb b/test/bootstrap_form_group_test.rb index f09b31026..6356afea6 100644 --- a/test/bootstrap_form_group_test.rb +++ b/test/bootstrap_form_group_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapFormGroupTest < ActionView::TestCase @@ -671,8 +673,8 @@ class BootstrapFormGroupTest < ActionView::TestCase test "non-default column span on form isn't mutated" do frozen_horizontal_builder = BootstrapForm::FormBuilder.new(:user, @user, self, layout: :horizontal, - label_col: "col-sm-3".freeze, - control_col: "col-sm-9".freeze) + label_col: "col-sm-3", + control_col: "col-sm-9") output = frozen_horizontal_builder.form_group { "test" } expected = '
test
' diff --git a/test/bootstrap_form_test.rb b/test/bootstrap_form_test.rb index 9bc0605e9..6bd2deb08 100644 --- a/test/bootstrap_form_test.rb +++ b/test/bootstrap_form_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapFormTest < ActionView::TestCase diff --git a/test/bootstrap_other_components_test.rb b/test/bootstrap_other_components_test.rb index c5c666323..d73395334 100644 --- a/test/bootstrap_other_components_test.rb +++ b/test/bootstrap_other_components_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapOtherComponentsTest < ActionView::TestCase diff --git a/test/bootstrap_radio_button_test.rb b/test/bootstrap_radio_button_test.rb index 1b64a4556..1f6098b28 100644 --- a/test/bootstrap_radio_button_test.rb +++ b/test/bootstrap_radio_button_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapRadioButtonTest < ActionView::TestCase diff --git a/test/bootstrap_rich_text_area_test.rb b/test/bootstrap_rich_text_area_test.rb index 5420b00ee..c32a1fb44 100644 --- a/test/bootstrap_rich_text_area_test.rb +++ b/test/bootstrap_rich_text_area_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" require "minitest/mock" diff --git a/test/bootstrap_selects_test.rb b/test/bootstrap_selects_test.rb index 7f1089a14..13cbb2e94 100644 --- a/test/bootstrap_selects_test.rb +++ b/test/bootstrap_selects_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapSelectsTest < ActionView::TestCase diff --git a/test/bootstrap_without_fields_test.rb b/test/bootstrap_without_fields_test.rb index fcb555e4e..a014497f7 100644 --- a/test/bootstrap_without_fields_test.rb +++ b/test/bootstrap_without_fields_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class BootstrapWithoutFieldsTest < ActionView::TestCase diff --git a/test/special_form_class_models_test.rb b/test/special_form_class_models_test.rb index 48079d09a..98550b39e 100644 --- a/test/special_form_class_models_test.rb +++ b/test/special_form_class_models_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "test_helper" class SpecialFormClassModelsTest < ActionView::TestCase diff --git a/test/test_helper.rb b/test/test_helper.rb index 7755ada57..1f117396e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + ENV["RAILS_ENV"] ||= "test" -puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop/ignore Rails/Output +puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop:disable Rails/Output require "warning" mail_gem_path = Gem::Specification.find_by_name("mail").full_gem_path