scrutinizer-ci / scrutinizer

Legacy repository - archives past feature requests/bug reports
https://scrutinizer-ci.com/docs
140 stars 36 forks source link

phpcs custom_coding_standard from dependency in vendor/ #380

Closed john-n-smith closed 8 years ago

john-n-smith commented 8 years ago

We keep our phpcs standard in a separate repository as it's used across multiple projects. It can then be installed and it's version managed via composer.

As dependencies aren't installed when phpcs is ran, a config like the following fails:

checks:
    php:
        custom_coding_standard:
             ruleset_path: 'vendor/bin/graze/standards/phpcs.xml'

Example failure here.

Is there a configuration directive to trigger dependency installation before code analysis, or the possibility of adding one?

This gives a single place to define phpcs' --standard for both scrutinizer and editors, rather than having to use the git_version directive.

schmittjoh commented 8 years ago

Yes, that is possible. We have some docs on this here: https://scrutinizer-ci.com/docs/tools/php/code-sniffer/

john-n-smith commented 8 years ago

Is there any way to reference the ruleset.xml from an installed dependency, rather than the git_version directive?

That means the dependancy is managed via composer, using version numbers, rather than hashes and means the the standard is defined in a single place for use by scrutinizer, running phpcs locally, and editors (via a phpcs.xml in the root of the project).

schmittjoh commented 8 years ago

Unfortunately, not at the moment. We will soon have something for this :)

john-n-smith commented 8 years ago

Great, I'll keep an eye out. Thanks for the great service.