I have installed the code sniffer and it works perfectly when invoked from command line.

What I'm trying to do is to put it in a pre commit svn hook in order to prevent commits with coding standard issues. I've kinda succeeded (something along the lines of http://gregsherwood.blogspot.com/2008/03/using-phpcodesniffer-in-svn-pre...).

The issue I have is with the WhiteSpace.FileEnd rule, it throws the following warning for each of the checked files when the pre commit hook is run:

PHP Warning:  file_get_contents(sites/all/modules/push_notifications/push_notifications.module): failed to open stream: No such file or directory in /home/martin/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/FileEndSniff.php on line 72

Warning: file_get_contents(sites/all/modules/push_notifications/push_notifications.module): failed to open stream: No such file or directory in /home/martin/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/FileEndSniff.php on line 72

Any ideas how to solve this are very welcome!

Comments

mmartinov’s picture

Issue summary: View changes

Changed the Warning message example.

mmartinov’s picture

Component: Code Sniffer » Coder Review
Issue summary: View changes
Status: Active » Closed (won't fix)