We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following rule is reported as an error from phpcs but cannot be excluded by the --exclude parameter : PSR2.Methods.FunctionCallSignature.Indent
<?php class TestClass { public function testMethod(string $testParam): void { echo $testParam; } }; $object = new TestClass(); $object->testMethod( 'testParam1' // <== Error is here );
<?xml version="1.0"?> <ruleset name="My Custom Standard"> <rule ref="PSR2.Methods.FunctionCallSignature.Indent"> <severity>5</severity> </rule> </ruleset>
Steps to reproduce the behavior:
test.php
custom-ruleset.xml
phpcs test.php --standard=custom-ruleset.xml test.php -s
FILE: /magento/test.php -------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------------------- 12 | ERROR | [x] Multi-line function call not indented correctly; expected 4 spaces but found 1 | | (PSR2.Methods.FunctionCallSignature.Indent) -------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------- Time: 10ms; Memory: 4MB
phpcs --standard=custom-ruleset.xml test.php -s --exclude=PSR2.Methods.FunctionCallSignature.Indent
ERROR: The specified sniff code "PSR2.Methods.FunctionCallSignature.Indent" is invalid Run "phpcs --help" for usage information
The rule should be ignored and the output clean
master
The text was updated successfully, but these errors were encountered:
@bhennesAdv The --exclude parameter only takes sniff names, not error codes. This is documented behaviour, not a bug.
--exclude
Also see #3895 (comment)
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
Sorry, something went wrong.
Hello,
Thank you, I had no idea about this difference. Sorry about that.
No branches or pull requests
Describe the bug
The following rule is reported as an error from phpcs but cannot be excluded by the --exclude parameter :
PSR2.Methods.FunctionCallSignature.Indent
Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above.custom-ruleset.xml
with the ruleset sample above.phpcs test.php --standard=custom-ruleset.xml test.php -s
phpcs --standard=custom-ruleset.xml test.php -s --exclude=PSR2.Methods.FunctionCallSignature.Indent
Expected behavior
The rule should be ignored and the output clean
Versions (please complete the following information)
Additional context
Please confirm:
master
branch of PHP_CodeSniffer. (Last release tested, not tested from code)The text was updated successfully, but these errors were encountered: