Skip to content

Exclude all Sniffs include specific Sniff #3975

Closed

Description

@FabianKoestring

Is there a way to exclude specific file types from every sniff and then include that file types for specific sniffs?

Like:

<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/vendor/squizlabs/php_codesniffer/phpcs.xsd">
    <arg name="extensions" value="php,phtml"/>

    <rule ref="LaminasCodingStandard">
        <exclude-pattern>*.phtml</exclude-pattern>
    </rule>

    <rule ref="PSR12.ControlStructures.ControlStructureSpacing">
        <include-pattern>*.phtml</include-pattern>
    </rule>
</ruleset>

Activity

  1. jrfnl commented on Oct 19, 2026

    @jrfnl
    Contributor

    Please don't open issues in this repo anymore. This repo is abandoned and https://github.com/PHPCSStandards/PHP_CodeSniffer is its successor. See: #3932

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions