Skip to content

Make the five always-on legacy rules configurable and fix a wrong error identifier - #1029

Merged
mglaman merged 1 commit into
mainfrom
audit/4-bc-changes
Sep 9, 2026
Merged

Make the five always-on legacy rules configurable and fix a wrong error identifier#1029
mglaman merged 1 commit into
mainfrom
audit/4-bc-changes

Conversation

@mglaman

@mglaman mglaman commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Part 8 of 9 in the legacy-code audit stack. One change that deserves release-note visibility and one small correctness fix.

What changed

Five always-on rules become configurable. DiscouragedFunctionsRule, GlobalDrupalDependencyInjectionRule, PluginManagerSetsCacheBackendRule, ModuleLoadInclude, and LoadIncludes move from the flat rules: block to the conditionalTags registration every newer rule uses, gated on new drupal.rules.* parameters. They default to true, so nothing changes for existing users — they gain a per-rule opt-out, documented in the README.

Wrong error identifier fixed. The "%s must override __construct if using YAML plugins." message in PluginManagerInspectionRule was reported under pluginManagerInspection.callAlterInfo, which belongs to a different check. It is now pluginManagerInspection.constructorOverrideMissing. No upgrade step is needed: since #1027 the rule only inspects classes that declare their own constructor, so this message cannot currently be reported and nobody has an ignoreErrors entry for it. Removing the unreachable branch is a separate follow-up.

Testing

Full suite, self-analysis, and phpcs are green.

🤖 Generated with Claude Code

@mglaman
mglaman force-pushed the audit/4-bc-changes branch from a84e67e to 5a205bc Compare August 5, 2026 16:20
@mglaman
mglaman force-pushed the audit/4-bc-changes branch from 5a205bc to 172090a Compare August 5, 2026 16:44
@mglaman
mglaman force-pushed the audit/4-bc-changes branch from 172090a to 0396c17 Compare August 5, 2026 17:15
@mglaman
mglaman force-pushed the audit/4-bc-changes branch from 0396c17 to 4843df6 Compare August 5, 2026 19:13
@mglaman
mglaman force-pushed the audit/4-bc-changes branch from 4843df6 to 54ac02c Compare August 5, 2026 19:33
@mglaman
mglaman force-pushed the audit/4-bc-changes branch 2 times, most recently from 134a974 to 34def2c Compare September 8, 2026 18:59
@mglaman
mglaman force-pushed the audit/4-bc-changes branch 2 times, most recently from 487b2f9 to cf96ccf Compare September 8, 2026 19:47
Base automatically changed from audit/3-modernization to main September 9, 2026 14:24
…or identifier

DiscouragedFunctionsRule, GlobalDrupalDependencyInjectionRule,
PluginManagerSetsCacheBackendRule, ModuleLoadInclude, and LoadIncludes
move from the flat rules: block to the conditionalTags registration all
newer rules use, gated on new drupal.rules.* parameters that default to
true. Behavior is unchanged; consumers gain a per-rule opt-out.

The 'must override __construct' message in PluginManagerInspectionRule
was reported under pluginManagerInspection.callAlterInfo, which belongs
to a different check. It is now
pluginManagerInspection.constructorOverrideMissing. Anyone ignoring the
old identifier for this message must update their configuration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mglaman
mglaman marked this pull request as ready for review September 9, 2026 14:36
@mglaman
mglaman merged commit 3d50c60 into main Sep 9, 2026
19 of 20 checks passed
@mglaman
mglaman deleted the audit/4-bc-changes branch September 9, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant