Closed sataris closed 9 years ago
Hi there @sataris - This looks to be a phpcbf error, and not the plugin?
@benmatselby , which is strange as I can execute it from the terminal just fine,
If i run the command that's output in the debug (ie. the normal phpcbf command)
[Phpcs] phpcbf /var/www/file.php --standard=PSR2
Everything works fine,
Processing file.php [PHP => 191 tokens in 28 lines]... DONE in 13ms (1 fixable violations) => Fixing file: 0/1 violations remaining [made 3 passes]... DONE in 43ms Patched 1 file Time: 91ms; Memory: 4.75Mb
Could it be a permission issue, where it can't write the diff file?
Heh, running the phpcbf in sublime with the --no-patch argument does indeed correct the issue.
Though I'm at a loss to explain why it can't write the diff file.
Sorry, cannot really help with that. I haven't come across those issues when I added the functionality, but I don't use that tool daily to be honest.
I also encountered the same issue, thanks for the workaround @sataris.
I'm seeing this when running from inside vim on ubuntu, on a whim I tried cd
ing to the directory's parent and tried again, it seemed to work. Something to do with having "up a level" in the path?
Might help someone else who lands here, probably won't help OP though.
Same annoying issue here, thanks for the --no-patch
workaround!
I also ecountered this problem but I think the issue is on codesniffer. Thanks about the --no-patch option it was very helpful. I could not find anything in codesniffer.
--no-patch also works for me, run from terminal
When trying to execute phpcbf on save, nothing happens.
Enabling debug produces the following output
Array ( [0] => Ignoring potentially dangerous file name /var/www/file.php [1] => can't find file to patch at input line 3 [2] => Perhaps you used the wrong -p or --strip option? [3] => The text leading up to this was: [4] => -------------------------- [5] => |--- /var/www/file.php [6] => |+++ PHP_CodeSniffer [7] => -------------------------- [8] => File to patch: [9] => Skip this patch? [y] [10] => Skipping patch. [11] => 1 out of 1 hunk ignored ) Returned: 1 Time: 89ms; Memory: 4.5Mb
Here are my settings
{ "phpcbf_executable_path": "phpcbf", "phpcbf_on_save": true, "show_debug": true, "phpcbf_additional_args": { "--standard": "PSR2", }, }