Skip to content
New issue

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

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

Open
slaFFik opened this issue Jan 31, 2025 · 0 comments
Open
Labels

Comments

@slaFFik
Copy link
Member

slaFFik commented Jan 31, 2025

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).

@slaFFik slaFFik added the bug label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant