From 119d5401b7be60b58f437124b5c0771f3710f8bb Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sat, 26 Sep 2026 09:26:00 -0700 Subject: [PATCH] Enable Style/FrozenStringLiteralComment Remove the `Style/FrozenStringLiteralComment: Enabled: false` override from .rubocop.yml so the cop runs with rubocop-gusto's `EnforcedStyle: always_true`. .rubocop_todo.yml has no entry for this cop. Add `# frozen_string_literal: true` to the five files that lacked it: packwerk-extensions.gemspec and four test fixtures under test/fixtures/skeleton. In the fixtures it goes after the existing `# typed:` sigil, matching every other file in the repo. None of the fixtures contain string literals, and no test depends on their line numbers. Everything else in lib/, bin/, test/, Rakefile and Gemfile already had the pragma. No mutation fixes were needed. The gemspec only passes its literals to Gem::Specification setters, which don't mutate them, and it loads and builds cleanly. The suite passes under --enable-frozen-string-literal, and the packwerk validate/check/update-todo commands run clean against a scratch app that triggers every checker and validator. --- .rubocop.yml | 4 ---- packwerk-extensions.gemspec | 2 ++ .../skeleton/components/timeline/app/models/graphql.rb | 1 + .../components/timeline/app/models/graphql/private_thing.rb | 1 + .../skeleton/components/timeline/app/models/private_thing.rb | 1 + test/fixtures/skeleton/config/environment.rb | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 087d9c0..5844558 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -38,10 +38,6 @@ Gemspec/RequireMFA: Style/NegatedIf: Enabled: false -# Disabling for now until it's clearer why we want this -Style/FrozenStringLiteralComment: - Enabled: false - # # Leaving length metrics to human judgment for now # diff --git a/packwerk-extensions.gemspec b/packwerk-extensions.gemspec index 3770f81..ddcb46a 100644 --- a/packwerk-extensions.gemspec +++ b/packwerk-extensions.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Gem::Specification.new do |spec| spec.name = 'packwerk-extensions' spec.version = '0.4.0' diff --git a/test/fixtures/skeleton/components/timeline/app/models/graphql.rb b/test/fixtures/skeleton/components/timeline/app/models/graphql.rb index 50e4664..8e18c0f 100644 --- a/test/fixtures/skeleton/components/timeline/app/models/graphql.rb +++ b/test/fixtures/skeleton/components/timeline/app/models/graphql.rb @@ -1,4 +1,5 @@ # typed: false +# frozen_string_literal: true module GraphQL end diff --git a/test/fixtures/skeleton/components/timeline/app/models/graphql/private_thing.rb b/test/fixtures/skeleton/components/timeline/app/models/graphql/private_thing.rb index 408f909..32d2899 100644 --- a/test/fixtures/skeleton/components/timeline/app/models/graphql/private_thing.rb +++ b/test/fixtures/skeleton/components/timeline/app/models/graphql/private_thing.rb @@ -1,4 +1,5 @@ # typed: false +# frozen_string_literal: true module GraphQL class PrivateThing diff --git a/test/fixtures/skeleton/components/timeline/app/models/private_thing.rb b/test/fixtures/skeleton/components/timeline/app/models/private_thing.rb index 652a077..52d9ebb 100644 --- a/test/fixtures/skeleton/components/timeline/app/models/private_thing.rb +++ b/test/fixtures/skeleton/components/timeline/app/models/private_thing.rb @@ -1,4 +1,5 @@ # typed: false +# frozen_string_literal: true class PrivateThing end diff --git a/test/fixtures/skeleton/config/environment.rb b/test/fixtures/skeleton/config/environment.rb index eb9f445..63d034a 100644 --- a/test/fixtures/skeleton/config/environment.rb +++ b/test/fixtures/skeleton/config/environment.rb @@ -1,3 +1,4 @@ # typed: false +# frozen_string_literal: true # this file intentionally left blank