Skip to content

Scope ExtraPathRule scans to their owning rules#42

Merged
PovilasKorop merged 1 commit into
mainfrom
issue/41
May 14, 2026
Merged

Scope ExtraPathRule scans to their owning rules#42
PovilasKorop merged 1 commit into
mainfrom
issue/41

Conversation

@krekas
Copy link
Copy Markdown
Collaborator

@krekas krekas commented May 14, 2026

Scope extra-path scans to their owning rules

Fixes #41.

Problem

ExtraPathRule::extraScanPaths() lets a rule register additional directories
to scan (today only DeprecatedTestMethodsRule uses it, for tests/ and
test/). The CLI was then handing those directories to the scanner with the
full rule set, so every rule ran on every test file.

That caused the false positives reported in #41: DeprecatedUrlParametersRule
rewrote Livewire wire-property names like tableFilters / tableSearch inside
Pest tests, breaking the suite at runtime because Filament's real Livewire
properties are still $tableFilters / $tableSearch.

Same bug existed in the --dirty branch — dirty test files were scanned with
every rule.

Fix

Each extra path is now scanned only with the rule(s) that requested it.

  • ResourceScanner::scan() accepts an optional ?array $rules; when set,
    only those rules run for that pass. Default behavior is unchanged.
  • bin/filacheck builds a path => Rule[] map from
    ExtraPathRule::extraScanPaths() and calls scan() with each path's owning
    rules. So tests/ runs only DeprecatedTestMethodsRule; the rest of the
    rules never see test files.
  • --dirty flow uses the same map: a dirty file inside the main path keeps
    the full rule set, a dirty file inside an extra path gets only its owning
    rule(s).

No rule files were modified — the ExtraPathRule contract is unchanged.

@PovilasKorop PovilasKorop merged commit 33eeebd into main May 14, 2026
10 checks passed
@PovilasKorop PovilasKorop deleted the issue/41 branch May 14, 2026 08:35
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.

deprecated-url-parameters rule fires on Livewire ->set() calls in test files

2 participants