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

Error running PhpCsFixerFixDirectory() without a file open #56

Open
jrebs opened this issue Sep 30, 2024 · 1 comment
Open

Error running PhpCsFixerFixDirectory() without a file open #56

jrebs opened this issue Sep 30, 2024 · 1 comment

Comments

@jrebs
Copy link

jrebs commented Sep 30, 2024

If you open a project directory and do not load any specific file (i.e. you cd myproject an then vim), when executing the PhpCsFixerFixDirectory() function on the PWD, php-cs-fixer will run correctly on the DIR and fix all of the same files that would be fixed if you ran the command line program against the dir. However, in vim this results in error output that seems to be caused by an assumption that there will be a loaded file to fix.

image

If I do the same thing as above, except I load any file within that project dir (even a non-php file such as README.md), then the output is error-free and simply reports the number of files modified. It seems to me that running the dir command on a dir should not result in any error output and should ideally not depend on file buffer being available since we are not targeting a file.

@linjialiang
Copy link

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