-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
If you define the same 'file' in two different notations, parallel running of phpcs triggers:
Code sample
<?php
namespace Func0der\PhpCsTest;
class Test
{
}
Custom ruleset
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="PSR12"/>
<file>src</file>
<file>./src</file>
</ruleset>
To reproduce
Steps to reproduce the behavior:
- Create a file called
src/Test.php
and aphpcs.xml
with the code sample above - Run
phpcs --parallel=50
- See error message displayed
PHP Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: Undefined index: in /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Files/FileList.php on line 187 in /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Runner.php:606
Stack trace:
#0 /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Files/FileList.php(187): PHP_CodeSniffer\Runner->handleErrors()
#1 /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Runner.php(487): PHP_CodeSniffer\Files\FileList->current()
#2 /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Runner.php(114): PHP_CodeSniffer\Runner->run()
#3 /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/bin/phpcs(18): PHP_CodeSniffer\Runner->runPHPCS()
#4 {main}
thrown in /home/vagrant/phpcs-test/vendor/squizlabs/php_codesniffer/src/Runner.php on line 606
Expected behavior
I am not sure what I would expect, because this could be a simple mis-configuration issue.
If this is intended behavior, I would expect a clearer error message.
Versions (please complete the following information):
- OS: Debian
- PHP: ^7.4
- PHPCS: ^3.5.8
- Standard: PSR12
Additional context
Repo to reproduce the problem: https://github.com/func0der/phpcs-test/blob/main/composer.json
Metadata
Metadata
Assignees
Labels
No labels