cvs: pear /PHP_CodeSniffer package.xml /PHP_CodeSniffer/scripts phpcs
| From: | Greg Sherwood | Date: | Tue, 18 Sep 2007 06:21:38 +0000 |
| Subject: | cvs: pear /PHP_CodeSniffer package.xml /PHP_CodeSniffer/scripts phpcs | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48622@lists.php.net to get a copy of this message | ||
squiz Tue Sep 18 06:21:38 2007 UTC
Modified files:
/pear/PHP_CodeSniffer/scripts phpcs
/pear/PHP_CodeSniffer package.xml
Log:
You can now change the default coding standard from PEAR to something else
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/scripts/phpcs?r1=1.19&r2=1.20&diff_format=u
Index: pear/PHP_CodeSniffer/scripts/phpcs
diff -u pear/PHP_CodeSniffer/scripts/phpcs:1.19 pear/PHP_CodeSniffer/scripts/phpcs:1.20
--- pear/PHP_CodeSniffer/scripts/phpcs:1.19 Mon Sep 17 05:09:09 2007
+++ pear/PHP_CodeSniffer/scripts/phpcs Tue Sep 18 06:21:37 2007
@@ -12,7 +12,7 @@
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
* @license http://matrix.squiz.net/developer/tools/php_cs/licence
BSD Licence
- * @version CVS: $Id: phpcs,v 1.19 2007/09/17 05:09:09 squiz Exp $
+ * @version CVS: $Id: phpcs,v 1.20 2007/09/18 06:21:37 squiz Exp $
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
@@ -87,7 +87,7 @@
// The default values for config settings.
$files = array();
-$standard = 'PEAR';
+$standard = null;
$verbosity = 0;
$local = false;
$report = 'full';
@@ -204,8 +204,13 @@
if (count($installedStandards) > 1) {
if ($standard === null) {
- echo 'ERROR: You must supply the name of the coding standard to
use.'.PHP_EOL.PHP_EOL;
- PHP_CodeSniffer_printUsage();
+ // They did not supply a standard to use.
+ // Try to get the default from the config system.
+ $standard = PHP_CodeSniffer::getConfigData('default_standard');
+ if ($standard === null) {
+ echo 'ERROR: You must supply the name of the coding standard to
use.'.PHP_EOL.PHP_EOL;
+ PHP_CodeSniffer_printUsage();
+ }
}
} else {
$standard = array_pop($installedStandards);
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/package.xml?r1=1.113&r2=1.114&diff_format=u
Index: pear/PHP_CodeSniffer/package.xml
diff -u pear/PHP_CodeSniffer/package.xml:1.113 pear/PHP_CodeSniffer/package.xml:1.114
--- pear/PHP_CodeSniffer/package.xml:1.113 Mon Sep 17 05:12:34 2007
+++ pear/PHP_CodeSniffer/package.xml Tue Sep 18 06:21:37 2007
@@ -33,6 +33,8 @@
<license uri="http://matrix.squiz.net/developer/tools/php_cs/licence">BSD
License</license>
<notes>
- Added a config system for setting config data across phpcs runs
+ - You can now change the default coding standard from PEAR to something else
+ -- Run: phpcs --config-set default_standard [standard]
- Added new Zend coding standard to check code against the Zend Framework standards
-- The complete standard is not yet implemented
-- Specify --standard=Zend to use