Skip to content

Certain file paths ignored per default #1815

@scheb

Description

@scheb
Subject Details
PHP version PHP 7.3.7
Full Command vendor/composer/bin/rector process src test -vvv

Current Behaviour

Hello there, I tried to upgrade my project with rector (great tool btw!) and was wondering why certain parts of my codebase aren't upgraded, although I haven't excluded these files and I've seen the files being auto-loaded during the parsing process. Running rector with -vvv revealed that they're never listed during [parsing].

Recognized that it's only ignoring directories with name "fixtures", which is where I store classes to load fixture data and prepare state. They're part of the test suite and they're code like everything else following the same coding standards and autoloading conventions, so I want to include them in the upgrade process of course.

Turned out that rector has some hardcoded filters to ignore certain file paths per default (including "fixtures") and these rules cannot be deactivated/overwritten. Imo that's a bad idea, because it is not obvious to the user and there's no way to contol this behavior.

Minimal PHP Code Causing Issue

->exclude(
['examples', 'Examples', 'stubs', 'Stubs', 'fixtures', 'Fixtures', 'polyfill', 'Polyfill', 'vendor']
)

Expected Behaviour

Rector should not make assumptions that certain paths can be excluded per default. Exclusion patterns should be required to be configured explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions