benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
812 stars 126 forks source link

Python exception raised when running phpcs #38

Closed ericandrewlewis closed 12 years ago

ericandrewlewis commented 12 years ago

Getting this error in the Sublime console when phpcs runs on save, not sure where to go from here. Tried resetting to Sublime defaults, reinstalling sublime-phpcs.

[Phpcs] phpcs --report=checkstyle -n --standard=PEAR /Users/ericlewis/Desktop/test.php
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./phpcs.py", line 288, in run
  File "./phpcs.py", line 108, in get_errors
  File "./phpcs.py", line 148, in execute
  File "./phpcs.py", line 151, in parse_report
  File "./phpcs.py", line 116, in shell_out
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
benmatselby commented 12 years ago

Hi there Eric

Could you see if https://github.com/benmatselby/sublime-phpcs#faq fixes the issue for me please. If not, post back

Thanks

ericandrewlewis commented 12 years ago

A surprising thing here is that my PATH variable does have the folder that the phpcs binary is in, which I set in .profile (working on OS X).

After adding it to the sublime-settings for phpcs_executable_path.

Thanks for the tip though, working fine now. ;)