Skip to content

Removal of search depth without dependency change does not update installed paths #150

@jrfnl

Description

@jrfnl

Problem/Motivation

The plugin updates the installed_paths when the installed dependencies have changed or the search depth has changed.

However, when the phpcodesniffer-search-depth is removed and the Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin::run() method is run, the plugin does not update the installed_paths.

So effectively, removing the phpcodesniffer-search-depth setting does not revert the search depth to the default search depth unless the installed dependencies are changed.

Discovered while working on the tests.

Expected behaviour

That the installed_paths would be updated based on the default search depth when the key is removed from extra in the composer.json file.

Actual behaviour

The installed_paths are still based on the old/removed search depth setting.

Steps to reproduce

Will follow once some "fake" (fixture) standards are in place for the tests as a standard which needs a "high" search depth is needed to demonstrate the issue and I don't know of one in the wild.

Proposed changes

To be determined

Environment

Question Answer
OS not relevant
PHP version not relevant
Composer version 2.2.5
PHP_CodeSniffer version 3.x
Dealerdirect PHPCS plugin version master
Install type not relevant

Tested against master branch?

  • I have verified the issue still exists in the master branch.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions