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

Created unit test for php files without extension #21

Closed
wants to merge 3 commits into from
Closed

Created unit test for php files without extension #21

wants to merge 3 commits into from

Conversation

muuvmuuv
Copy link

@muuvmuuv muuvmuuv commented Nov 8, 2018

This is for files like e.g. .php_cs, see #5 for more information

Error result with jest => spawn phpcbf ENOENT
Error stdout =>


No fixable errors were found

Time: 36ms; Memory: 4Mb

To reproduce stdout error:

tested in VS Code 1.28.2

  1. go to file test/PHPWithoutExtension/PHPWithoutExtension
  2. change the language to PHP
  3. Format the file

@Glavin001 Glavin001 added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2018
@Glavin001
Copy link
Member

@muuvmuuv Thanks for creating this failing test case! I'm not familiar enough with PHP-CodeSniffer to recognize the problem here. This is the applicable code: https://github.com/Unibeautify/beautifier-php-codesniffer/blob/master/src/index.ts#L91-L100
Once we know how PHP-CodeSniffer expects to receive the arguments we can easily change it.

@muuvmuuv
Copy link
Author

@Glavin001 me neither. I will create an issue on their repo. I have also recognised that phpcbf has problems with files without an extension or another than .php, maybe that is another issue of phpcs

@muuvmuuv
Copy link
Author

@Glavin001 okay it seems it is like it is, we could only add a filter to allow files without extension but I think this is out of scope somehow. Let's just leave it as it is and if someone will report this again, we will point to squizlabs/PHP_CodeSniffer#1754 and squizlabs/PHP_CodeSniffer#2225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed PR: unreviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants