Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how does this library handle multiple standards as dependencies ? #24

Closed
jrfnl opened this issue May 1, 2017 · 4 comments
Closed
Assignees

Comments

@jrfnl
Copy link
Member

jrfnl commented May 1, 2017

Question

Say you have a project in which you require both a project specific coding standard, such as the Joomla or WordPress Coding Standards, as well as the PHPCompatibility standard to check for cross-version compatibility issues.

Assume that both these PHPCS standards require this library and have their type set to phpcodesniffer-standard,

How does this installer handle that ?

PHPCS by default overwrites a previously registered installed_path when the command is run again.

Does this library collect all the paths and run the command once at the end ? Or would each subsequent CS dependency overwrite the path like PHPCS does ?

Related: squizlabs/PHP_CodeSniffer#1436

@Potherca Potherca self-assigned this May 2, 2017
@Potherca
Copy link
Member

Potherca commented May 2, 2017

Given the scenario that a user has defined two sniffs as a dependency, the installer installs both sniffs.

The path of both sniffs are added to the PHP Codesniffer configuration file at vendor/squizlabs/php_codesniffer/CodeSniffer.conf.

A full working example, including a more verbose explanation can be found at https://github.com/Potherca/phpcodesniffer-composer-installer_issue-24

If anything is unclear or information is missing, don't hesitate to ask.

@jrfnl
Copy link
Member Author

jrfnl commented May 3, 2017

@Potherca Thanks for the clarification. One more question: what about if the user installs the sniff library as "global" using Composer and they already have one or more other standards installed globally ? (which they're not updating at the same time)

@Potherca
Copy link
Member

Potherca commented May 3, 2017

The behaviour between "global" or "local" install is the same.

If a sniff is already installed before the installer is installed, the installer does not do anything when it is installed (as the sniff is already installed and no installation is needed).

However, when another sniff is installed after the installer has been installed, both sniffs will be installed by the installer.

I have updated and expanded the working example to including these scenario's (both the incremental scenario and the global scenario).

@jrfnl
Copy link
Member Author

jrfnl commented May 3, 2017

@Potherca Thanks for the clarification. This has answered my questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants