Follow these steps to integrate Drupal Code Sniffer into Eclipse.
- Install Eclipse
- Install PTI Plugin
- Configure PTI:
- Open Eclipse preferences -> PHP Tools -> PHP Codesniffer
- Add a new "CodeSniffer Standard" - choose this library
- Activate the library by checking the checkbox next to its name.
- Make sure the Standard Tab Width configuration is set to 0. Otherwise you won't get notified about evil tabs in the code.
Use the PHP Tools entry in the context menu (right click) in the navigator or hit "Validate" within the context menu (right click) of a file.
- Disable the autorun of validators to save performance.
- Configure the "CodeSniffer Standard" to be use per project.
- Please use the latest version of PTI to use it with Eclipse Indigo