Skip to content

Commenting/PhpcsAnnotation breaks PHPCS native ignore annotation handling #208

Open
@jrfnl

Description

@jrfnl

The sniff overrides the token content of PHPCS ignore annotations to allow for fixing these but doesn't revert that change correctly once the sniff is done, which means that this change will affect all sniffs and breaks the PHPCS native ignore annotation handling.

The issue is straight-forward to reproduce.

Given the below file:

<?php
/**
 * @phpcs:ignoreFile
 */

Class Foo {}

When running this command:

phpcs -ps ./webimpress-breaks-ignores.php --report=full,source --standard=WebImpressCodingStandard

I'd expect to see no errors. Instead I get 6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions