PHPCSStandards / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
805 stars 47 forks source link

option --p not known #516

Closed CollectionAgency closed 1 month ago

CollectionAgency commented 1 month ago

Describe the bug

I keep getting the error option "--p" not known I installed phpcs the regular way through composer

Custom ruleset

<?xml version="1.0"?>
<ruleset name="Project Rules">
    <description>Project-specific PHP_CodeSniffer rules</description>

    <!-- Include the PSR-12 standard -->
    <rule ref="PSR12"/>

    <!-- Exclude specific sniffs -->
    <exclude name="Generic.Functions.OpeningFunctionBraceBsdAllmanSniff"/>
    <exclude name="Generic.Files.LineLength"/>

    <!-- Exclude specific directories -->
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>/revolution/*</exclude-pattern>
    <exclude-pattern>*mollie*</exclude-pattern>

    <!-- Include specific file extensions -->
    <file>./</file>
    <extensions>
        <extension>php</extension>
    </extensions>

    <!-- Enable colors in output -->
    <arg name="colors"/>

    <!-- Show progress of the checks -->
    <arg name="p"/>
</ruleset>

To reproduce

image

Expected behavior

For it to just execute the commands. I'm trying to use the phpcs.xml file, but it doesn't detect it either.

Versions

Operating System [Windows 11]
PHP version [7.4]
PHP_CodeSniffer version [3.10.1 (stable)]
Standard [PSR12]
Install type [Composer]
jrfnl commented 1 month ago

@CollectionAgency Please don't abuse the bug report system for support questions. Closing as user error.

-<arg name="p"/>
+<arg value="p"/>

See: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset