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

phpcs: support multiple standards #173

Closed
jonhattan opened this issue Jul 11, 2019 · 1 comment · Fixed by #177
Closed

phpcs: support multiple standards #173

jonhattan opened this issue Jul 11, 2019 · 1 comment · Fixed by #177

Comments

@jonhattan
Copy link

phpcs does support multiple standards (--standard=PEAR,PSR2). See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage#specifying-a-coding-standard, but phpqa limits this to only one.

I'll prepare a PR to allow for multiple standards.

@zdenekdrahos
Copy link
Member

Quickfix: multiple standards are supported in XML file.

<!-- phpcs.xml -->
<?xml version="1.0"?>
<ruleset name="ACME">
    <description>The coding standard for ACME PHP source code</description>

    <rule ref="PSR1" />
    <rule ref="PSR2" />

    <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
        <exclude-pattern>*/app/presenters/*.php</exclude-pattern>
    </rule>
    <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
        <exclude-pattern>src/Exceptions.php</exclude-pattern>
    </rule>
</ruleset>
# .phpqa.yml
phpcs:
    standard: phpcs.xml

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

Successfully merging a pull request may close this issue.

2 participants