Module: Glib::Test::RubocopGuards

Extended by:
ActiveSupport::Concern
Defined in:
lib/glib/test/rubocop_guards.rb

Overview

Conscious opt-in for the suite-time RuboCop guard. Including this module ONCE in the project's test setup IS the project's explicit decision to run it. It must stay a separate include precisely because Glib::TestHelpers is mixed in for unrelated reasons (crawlers, travel helpers): auto-requiring the guard from there would enable it without any conscious decision, and FullSuiteRubocop runs rubocop -a, which REWRITES files on disk.

class ActiveSupport::TestCase
include Glib::Test::RubocopGuards # opts in: full-suite `rubocop -a`
end

This module is defined as soon as the gem loads (glib/test_helpers requires it at file level), so the include works on its own — in ActiveSupport::TestCase or in a single test class — with no ordering dependency on Glib::TestHelpers.

What the include switches on: Glib::Test::FullSuiteRubocop — rubocop -a over the whole repo on every rails test invocation, failing when anything was rewritten or remains (runs under CI too).

MIGRATION NOTE: in the published releases before this change (6.9.3 and earlier as released), Glib::TestHelpers auto-required a report-only ChangedFilesRubocop guard (working-tree edits only, skipped under CI), so every project had it without asking. That guard is retired: FullSuiteRubocop is a superset, and the local rails-test wrapper sets CI=true, where the old guard never ran anyway. A project bumping to the first release that contains this change must add the include line above or it silently has no suite-time RuboCop guard at all.