-
Notifications
You must be signed in to change notification settings - Fork 1.5k
How to add single file without extension to check? #2916
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
Comments
Sorry, I missed the notification for this issue. You are correct, files without an extension are filtered out and the There is no way to tell PHPCS to check files without an extension. Having PHPCS pick up files with no extension by default would break quite a lot of test runs, so that's not something I want to do. I think that specifying the file path directly would be fine though. I'm going to throw this on the 4.0 roadmap because I've removed JS and CSS tokenizing support there, which lets PHPCS assume that all specified files are PHP files - as it originally did. This makes re-introducing support for files with no extension much easier. |
I've changed the behaviour of PHPCS in the 4.0 branch so that files with no extension are checked if you pass in the path directly on the command line, or via a ruleset |
Thanks @gsherwood |
@gsherwood |
@jrfnl @gsherwood |
@AlexSkrypnyk It won't be backported to 3.x, but 4.0 is around the corner by now - see PHPCSStandards/PHP_CodeSniffer#924 |
I want to add a single file without extension (or with a name starting with a dot), but cannot achieve this. Neither with
<file>
in XML or with the command line.E.g. when I run
./bin/phpcs ./bin/phpcs ./src/Config.php
in this repo the output is1 / 1 (100%)
, where the1
is for the latter file.I've found this: https://github.com/squizlabs/PHP_CodeSniffer/blob/3.5.4/src/Filters/Filter.php#L168 and this implies that this line: https://github.com/squizlabs/PHP_CodeSniffer/blob/3.5.4/phpcs.xml.dist#L6 is useless, right?
The text was updated successfully, but these errors were encountered: