-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Hidden files ignored even if explicitly defined #395
Comments
@Rasmus-Bertell This is not a bug, but by design. Hidden files are not checked. Also see: squizlabs/PHP_CodeSniffer#1928 Considering this is only the second time this has comes up in 6 years, I'm not so sure it is desirable to change this behaviour in PHPCS. Moreover, as it would constitute quite a big BC-break, the change could only be made in a major release. I'm going to leave this ticket open for a while to see if more people show interest. |
Loosely related: squizlabs/PHP_CodeSniffer#2916 (checking of files without extension, which will be included in v 4.0). |
I understand that hidden files are skipped when checking folders but if I explicitly define the file to be checked I would expect the program to check the file regardless of what kind of a file it is. |
@Rasmus-Bertell I would consider a PR to add that as a feature in PHPCS 4.0 - allow scanning hidden files, but only when the file is explicitly declared by name in the I suspect the change will not be that easy to make though, so I will only accept it once the existing Filter functionality has been fully covered by tests to ensure the patch doesn't break anything. Would you be interested to work on this ? |
While I would like to help, I have too many projects going on at the moment. I'll consider it when I get some of them off my plate. In the meanwhile I have a workaround to format the files so you can close this if you want to. |
Understood. I'll leave the ticket open for now. There may be others interested in the feature and/or interested on working on the feature. If not, we can always still close it at a later point in time. |
@jrfnl I think that, if (at least) a file is specified explicitly in the config - it should be included. The config defines the user's intention. Currently, that intention is not respected. So to me, this looks like an inconsistency that would be great to have rectified. Thank you |
@AlexSkrypnyk Scanning files without extension is a completely different thing and is already on the roadmap for the 4.0 release. Scanning (and by extension auto-fixing) hidden files is what this issue is about and like I said above, while I'm not necessarily against it, providing the files are explicitly requested to be scanned (by name), I will not accept a PR for this without full test coverage of the feature which is being changed. |
Closing as there has not been any additional interest. |
Describe the bug
I have two identical files
app/Models/Locale.php
andapp/Models/.Locale.php
phpcs only reports the errors on the first one and phpcbf only fixes the first one.Code sample
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample abovecp test.php .test.php
phpcs test.php
phpcs .test.php
phpcbf test.php
phpcbf .test.php
Expected behavior
I expect it to run the same regardless of the filename.
Versions (please complete the following information)
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: