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

PHPCBF stopped working altogether after v0.30.1. Throws 'Could not find 'PHPCBF'. The program may not be installed' #1730

Closed
avivais opened this issue Jun 19, 2017 · 9 comments
Assignees
Milestone

Comments

@avivais
Copy link

avivais commented Jun 19, 2017

After last update I cannot beautify using PHPCBF anymore.
Previously, it worked "out-of-the-box", now even when setting the path explicitly it still complains about not finding the executable

screen shot 2017-06-19 at 18 29 47

screen shot 2017-06-19 at 18 30 21

screen shot 2017-06-19 at 18 31 22

Running on latest macOS Sierra (10.12.5)

debug.md

@Glavin001
Copy link
Owner

Glavin001 commented Jun 19, 2017

@prasadfutballer please subscribe to this Issue.


From #1725 (comment)

From your logs:

2017-06-19T08:17:11.568Z - debug: [] spawn done 0  PHP_CodeSniffer version 3.0.1 (stable) by Squiz (http://www.squiz.net)

2017-06-19T08:17:11.569Z - verbose: [] spawn result, returnCode 0
2017-06-19T08:17:11.569Z - verbose: [] spawn result, stdout PHP_CodeSniffer version 3.0.1 (stable) by Squiz (http://www.squiz.net)

2017-06-19T08:17:11.569Z - verbose: [] spawn result, stderr 
2017-06-19T08:17:11.569Z - info: [] Version text: PHP_CodeSniffer version 3.0.1 (stable) by Squiz (http://www.squiz.net)

2017-06-19T08:17:11.569Z - error: []  Error: Version is not valid: null
    at /home/mindset/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:96:21

Note when phpcbf --version is run the response is PHP_CodeSniffer version 3.0.1 (stable) by Squiz (http://www.squiz.net). This is not being correctly handled at

args: ['--version']
. By default (which is how it currently is configured) it will expect the response to be exactly 3.0.1.

This should be a quick fix I will have to test out tomorrow and publish a new release. Until then, please downgrade so you can still be productive and I will fix this ASAP. Thanks!

@Glavin001 Glavin001 self-assigned this Jun 19, 2017
@Glavin001 Glavin001 added this to the v0.31.0 milestone Jun 19, 2017
@Glavin001
Copy link
Owner

@avivais Thanks for reporting. I will be fixing this ASAP (likely tonight). Please downgrade to last working version, v0.29.26, and I will post here once a fix has been published. Thanks!

@avivais
Copy link
Author

avivais commented Jun 19, 2017

@Glavin001 thank you for the (very) fast response! I just updated PHPCBF via composer to 2.9.1 (stable) by Squiz (And not 3.0.1 as you mentioned).
I now get a different error:

Error parsing PHPCS response
Something went wrong attempting to parse the PHPCS output

How do you suggest I downgrade? Won't it (Beautify package that is) keep being updated automatically?

@Glavin001
Copy link
Owner

How do you suggest I downgrade? Won't it (Beautify package that is) keep being updated automatically?

I'm not familiar with any auto-updating package functionality in Atom. Maybe I missed it -- I manually choose when to update my packages.

Downgrading Atom-Beautify would be: apm install [email protected]. Let me know if that does not work.

I just updated PHPCBF via composer to 2.9.1 (stable) by Squiz (And not 3.0.1 as you mentioned).

The quote block above was from another user, who has the exact same issue, on another PHPCBF version. Atom-Beautify is having troubles parsing the version. It expects phpcbf --version to return 3.0.1 or 2.9.1 however it instead receives PHP_CodeSniffer version 3.0.1 (stable) by Squiz (http://www.squiz.net). So I will need to add support for both 😄 .

@prasadfutballer
Copy link

prasadfutballer commented Jun 19, 2017

@avivais I actually upgraded PHPcode_sniffer to 3.0.0, then it stopped working, then tried downgrading to 2.9.0 and still had this issue. So right now i am running PHPcode_sniffer 2.6.0 whicch works perfectly with atom beautify 0.29.26

As glavin001 suggested, to download atom beautify use the command apm install [email protected] and to download phpcbf sudo pear install -f PHP_CodeSniffer-2.6.0 on an ubuntu system

@Glavin001
Copy link
Owner

Published fixes to v0.30.2

kumekay added a commit to kumekay/atom-beautify that referenced this issue Jun 20, 2017
* master: (79 commits)
  Update changelog [skip ci]
  Prepare 0.30.2 release
  Fixes Glavin001#1030. Add support for alpha versions of autopep8
  Fixes Glavin001#1725. Fix version parsing of PHP executable
  Fixes Glavin001#1730. Correctly parse PHPCBF version and improve handling of Executable
  See Glavin001#1708. Re-generate documentation for Fortran file extension changes
  Prepare 0.30.1 release
  Prepare changelog for v0.30.1
  See Glavin001#1725. Update changelog
  Fixes Glavin001#1725. Improve PHP-CS-Fixer support with handling script path
  Update changelog. See Glavin001#1030.
  Fix Glavin001#1030. Autopep8 Executable did not handle older and newer versions
  Prepare 0.30.0 release
  See Glavin001#1687. Update README, remove note about Executables now that it is supported
  See Glavin001#1687. Update Changelog with info about Executables
  Add Greenkeeper badge
  See Glavin001#1687. Update README docs to include details about Executables and Docker support
  Add more dependencies to next-update and greenkeep ignore list
  See Glavin001#1687. Fix typos in Travis CI config
  See Glavin001#1687. Install Sass-convert and Uncrustify beautifiers via Docker for Linux Travis CI build
  ...

# Conflicts:
#	README.md
@avivais
Copy link
Author

avivais commented Jun 21, 2017

@Glavin001 updated to v0.30.2 and still get the "Error parsing PHPCS response". This is my updated debug.md

@Glavin001
Copy link
Owner

2017-06-21T12:59:35.674Z - error: [beautifiers/index.coffee] ReferenceError: path is not defined
at /Users/avivais/.atom/packages/atom-beautify/src/beautifiers/phpcbf.coffee:63:49

Looks like I have an error: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/phpcbf.coffee#L63
Missing requiring path. Will have to fix this later.

@avivais Pull requests welcome, by the way 😄 . May be quicker than me patching and retrying, since your system setup is likely differently than my own.

@avivais
Copy link
Author

avivais commented Jun 21, 2017

@Glavin001 point taken :)

Actually that error message was the linter, not the beautifier - Sorry on that (Though it did help discovering the path issue ;) ).

Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants