Skip to content

[3.x] - The "No sniffs were registered." is outputted to STDOUT instead of STDERR. #1283

@yCodeTech

Description

@yCodeTech

Describe the bug

In the latest of 3.x (3.13.4), the "No sniffs were registered" error (and maybe other errors?) seems to be outputted to STDOUT for both phpcs and phpcbf. Shouldn't this be to STDERR?

I'm now a co-maintainer of the vscode extension PHP Sniffer & Beautifier, and while the 3.x is still supported, trying to catch these errors in STDOUT for the phpcbf is particularly painful, while also getting the potentially fixed content in other scenarios.

In 4.x, this particular error is outputted to STDERR, so would it be possible to backport this into 3.x please`

Custom ruleset

To test the "No sniffs were registered" error, I'm using an empty ruleset.

<?xml version="1.0"?>
<ruleset name="My Custom Standard">
  <description>If you are using a custom ruleset, please enter the relevant part here.</description>
</ruleset>

Expected behavior

The "No sniffs were registered" and other errors to be sent to STDERR.

Versions (please complete the following information)

Operating System Windows 10
PHP version 8.2.9
PHP_CodeSniffer version 3.13.4
Standard None
Install type Composer (global/local)

Please confirm

  • I have searched the issue list and am not opening a duplicate issue.
  • I have read the Contribution Guidelines and this is not a support question.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the 4.x branch of PHP_CodeSniffer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions