Closed (works as designed)
Project:
Drupal Code Sniffer
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
6 Aug 2012 at 23:12 UTC
Updated:
7 Sep 2012 at 14:43 UTC
Jump to comment: Most recent file
Comments
Comment #1
decafdennis commentedThe problem is that
_drupalcs_get_phpcs_version_numbercalls ondrush_shell_exec_outputto get the output of the last shell command, and in that relying on_drupalcs_get_phpcs_versionto calldrush_shell_exec. Unfortunately,_drupalcs_get_phpcs_versionstatically caches its result and doesn't calldrush_shell_execa second time and therefore doesn't have the side-effect that_drupalcs_get_phpcs_version_numberrelies on.The attached patch resolves that problem.
Additionally, I want suggest
_drupalcs_get_phpcs_versionis renamed to_drupalcs_is_phpcs_installedor that some other refactoring takes place to have things make more sense.Comment #2
klausiBut that is the wrong fix - the function should examine the returned $result to extract the version number.
Comment #3
klausiCurrently _drupalcs_get_phpcs_version() returns TRUE or FALSE, but it should return the version output from phpcs. Therefore we need to use drush_shell_exec_output() in that function.
Comment #4
decafdennis commentedThe attached patch has
_drupalcs_get_phpcs_version()return the version number from the output ofphpcs --version, as you requested. It also gets rid of_drupalcs_get_phpcs_version_number(), which is now redundant.Comment #5
klausiThanks, committed!
Comment #6
deverman commentedHi I downloaded the dev version of this module:
---
bash-3.2$ more drupalcs.info
; This file is populated by the drupal.org packaging script with date and
; version information for downloadable releases.
name = Drupal Code Sniffer
; Information added by drupal.org packaging script on 2012-08-08
version = "7.x-1.0-beta1+10-dev"
core = "7.x"
project = "drupalcs"
datestamp = "1344384957"
---
I still get this error message. I have tried clearing the drush cache. Still get tis error message. Please let me know if there is anything I can do to fix this?
--
No compatible version of PHP_CodeSniffer was found; you must have 1.3.4 or higher. Alternatively, you can symbolically link with the following command: sudo ln -sv /Users/username/.drush/drupalcs/Drupal $(pear config-get php_dir)/PHP/CodeSniffer/Standards/Drupal
Comment #7
klausiWhat version of phpcs have you installed?
Comment #8
klausiReopen if this is still an issue.