Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Request #11886 Allow command line input of sniffs directory
Submitted: 2007-08-22 03:20 UTC
From: doconnor Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 0.8.0)
PHP Version: 5.2.3 OS:
Roadmaps: 1.0.0    
Subscription  


 [2007-08-22 03:20 UTC] doconnor (Daniel O'Connor)
Description: ------------ Say I have my own coding standard, and I store it in a directory structure in SVN. project project\PEAR\PHP\CodeSniffer\Standards\MyStandard I have no easy way to instruct the command line tool to look for my standard in an alternative directory. That means if I want to do a standard, I have to make use of the pear installer. That's fine, except if I'm making a lot of incremental changes to the coding standard, and have to continuously redeploy it to the continuous integration box. PHP_CodeSniffer::getInstalledStandards() looks like it can take a few more arguments

Comments

 [2007-08-22 03:36 UTC] squiz (Greg Sherwood)
Nice feature. Unless you are on Windows (and it looks like you might be), you might be able to do it now. Symlink your coding standards dir into CodeSniffer/Standards and PHP_CodeSniffer will see it as a valid coding standard. Someone is currently having a problem with this, but it is working for me.
 [2007-12-17 04:37 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. You can now specify the full path to a standard on the command line rather than having to use one of the standards in PHP_CodeSniffer's standard dir. phpcs --standard=/path/to/MyStandard You still need to have a MyStandardCodingStandard.php file inside there for it to be considered a valid coding standard. All classes, dirs and files need to be named as if the standard was part of PHP_CodeSniffer itself.