Skip to content

Error running PhpCsFixerFixDirectory() without a file open #56

@jrebs

Description

@jrebs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions