Skip to content

Add per-rule enabled config#30

Merged
PovilasKorop merged 1 commit into
mainfrom
configurable-rules
Mar 18, 2026
Merged

Add per-rule enabled config#30
PovilasKorop merged 1 commit into
mainfrom
configurable-rules

Conversation

@krekas
Copy link
Copy Markdown
Collaborator

@krekas krekas commented Mar 16, 2026

Every FilaCheck rule can now be individually enabled or disabled via a published config file.

config/filacheck.php (new file)

A new config file is introduced with an enabled key for each of the 16 rules, all defaulting to true.

src/FilacheckServiceProvider.php

The service provider now loads and publishes the config, then filters the rule list before registering. Disabled rules are never passed to the scanner, so they are skipped entirely — not just silenced.

New behaviour

To disable a rule, publish the config and set enabled to false:

php artisan vendor:publish --tag=filacheck-config
// config/filacheck.php
'deprecated-reactive' => [
    'enabled' => false,
],
  • Rules default to enabled: true, so existing installations are unaffected.
  • Disabling a rule removes it from the registry entirely — it won't appear in output or count toward any totals.
  • No changes were made to individual rule classes.

@PovilasKorop PovilasKorop merged commit 2aaf5b0 into main Mar 18, 2026
6 checks passed
@PovilasKorop PovilasKorop deleted the configurable-rules branch March 18, 2026 19:30
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.

2 participants