Skip to content

AddEmptyLineBefore sniff triggered for a line that has phpcs:ignore rule #65

@slaFFik

Description

@slaFFik

Here is the example code:

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
switch ( $_GET['action'] ?? 'login' ) {

}

Here is a sniff that I get:

Image
phpcs: WPForms.Formatting.Switch.AddEmptyLineBefore: You should add an empty line before

Ideally, WPForms.Formatting.Switch.AddEmptyLineBefore should understand/respect the situations, when it requires a new line before the switch, but this new line is occupied by a PHP comment (maybe not any comment - but the phpcs-related comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions