Hi,
Here are some steps I took to get PHP Code Sniffer (phpcs) and DrupalCodingStandard standard working in Komodo Edit 6 on Ubuntu 11.
It provides you with a new tool button and formats the output correctly.
This requires phpcs to be installed and the DrupalCodingStandard folder from the Drupal Code Sniffer module to be copied-to or linked-to-from the standards folder in your phpcs install folder as described on the module home page.
- Open Komodo
- In the Tools menu select 'Run Command'
- In the Run dialog do the following:
- At the top, Give the command a name e.g PHPCS_DrupalCodeSniffer
- In the 'Command' input enter:
phpcs -n --standard=DrupalCodingStandard --extensions=php,module,inc,install,test,profile,theme --report=emacs %F
- Uncheck 'Insert Output'
- Uncheck 'Pass Selection'
- In the 'Start in' input ender:
%D
- From 'Run in' drop down choose 'Command Output Tab'
- Uncheck 'Do not open output pane'
- Check 'Parse output with'
- In the 'Parse output with' input enter:
^(?P<file>.*):(?P<line>\d+):(?P<column>\d+):(?P<content>.*)
- Check 'Show parsed output as a list'
- On Linux you do not need to enter any environment variables if you have install PHPCS properly
- Press OK
Then, if you open your Toolbox in one of your IDE panes, you will have a new button which you can click on and the open file will be checked using PHPCS using the DrupalCodingStandard standard.
These settings can be expanded to check whole module folders but this is a good place to start.
If some one else can confirm this works then perhaps it could get added to the documentation ?
Also, some images attached for help. The first shows the config dialog settings as descibed above and the second shows it in action.
Jowan
more info http://blog.8bitplateau.net/drupa-code-sniffer-komodo/
Comment | File | Size | Author |
---|---|---|---|
phpcs.png | 294.6 KB | 8bitplateau | |
dialog.png | 61.19 KB | 8bitplateau |
Comments
Comment #1
ericduran CreditAttribution: ericduran commentedThanks. Added a link to the blog post on the project page with the heading of Komodo integration.
Comment #2.0
(not verified) CreditAttribution: commentedupdated parse code