Skip to content

Add PHP_Codesniffer to require #54

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

Merged
merged 2 commits into from
Jun 30, 2017
Merged

Conversation

davidwindell
Copy link
Contributor

No description provided.

@zlik zlik requested review from zlik and Zifius June 30, 2017 16:59
Copy link
Contributor

@zlik zlik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to explicitly require PHP_CodeSniffer but rather always install it only once system-wide and use for all projects:

composer global require "squizlabs/php_codesniffer=*"

So I would just update README to indicate this is a desirable method.

@davidwindell
Copy link
Contributor Author

We use fresh Docker images per project so we wouldn't install it globally.

If you have global required it, won't composer detect this and not install on the project level?

Copy link
Contributor

@zlik zlik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidwindell, you're right - PHP_CodeSniffer will not be installed on the project level if installed globally. RP approved.

@zlik zlik removed the request for review from Zifius June 30, 2017 19:00
@zlik zlik merged commit fbeeb7a into magento-ecg:master Jun 30, 2017
@zlik
Copy link
Contributor

zlik commented Jun 30, 2017

@davidwindell, I apologize I had to revert the pull request because PHPCS will actually be installed on the project level even when installed globally. You can add a command to install PHPCS globally to your provisioning script. I updated README with the recommended installation method.

@zlik
Copy link
Contributor

zlik commented Jun 30, 2017

@davidwindell,
Note: Alternatively to installing PHP_CodeSniffer globally, you can include dependencies for both magento-ecg/coding-standard and squizlabs/php_codesniffer in your composer.json file. For example:

{
    "require": {
        "magento-ecg/coding-standard": ">=3.0",
        "squizlabs/php_codesniffer": "3.*"
    }
}

@davidwindell
Copy link
Contributor Author

Yep, that's what we've been doing but the usual practice is to require all dependencies at the vendor level.

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