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

Overriding Slevomat Files standard in a file #8

Open
MikeiLL opened this issue Jan 22, 2023 · 1 comment
Open

Overriding Slevomat Files standard in a file #8

MikeiLL opened this issue Jan 22, 2023 · 1 comment

Comments

@MikeiLL
Copy link

MikeiLL commented Jan 22, 2023

Hey, my friend.

In a particular file:

<?php
/**
 * File Name
 *
 * @phpcs:disable SlevomatCodingStandard.Files.FileLength.FileTooLong
 * /

Doesn't work:

   1 | ERROR   | [ ] Your file is too long. Currently using 444 lines. Can be up to 260 lines.
     |         |     (SlevomatCodingStandard.Files.FileLength.FileTooLong)

Though, this directive is honored:

@phpcs:disable SlevomatCodingStandard.Classes.ClassLength.ClassTooLong

It will be honored when run with the --standard=SlevomatCodingStandard specified. Also other Files directives are not disabling as expected.

Any thoughts?

@Mte90
Copy link
Member

Mte90 commented Jan 23, 2023

Looking at https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file I think that doesn't work on doc block.
Requires the // I don't find any examples in that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants