[Pkg-owncloud-commits] [php-sabre-vobject] 03/16: Added phpcs.

David Prévot taffit at moszumanska.debian.org
Mon Jul 21 19:19:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 2db065e61208ff83428ae2f08d5d10faf3b40f5b
Author: Evert Pot <me at evertpot.com>
Date:   Wed Jun 25 14:56:27 2014 -0400

    Added phpcs.
---
 .gitignore              |  1 +
 .travis.yml             |  2 ++
 composer.json           |  3 ++-
 tests/phpcs/ruleset.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 0c6b076..1c46a29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ tests/temp
 
 #binaries
 bin/phpunit
+bin/phpcs
 
 # Development stuff
 testdata/
diff --git a/.travis.yml b/.travis.yml
index c77252f..41d80cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,5 +13,7 @@ matrix:
 
 script:
   - phpunit --configuration tests/phpunit.xml
+  - ./bin/phpcs  -v --standard=tests/phpcs/ruleset.xml lib/
+
 
 before_script: composer install
diff --git a/composer.json b/composer.json
index 5ca014e..91238d2 100644
--- a/composer.json
+++ b/composer.json
@@ -9,7 +9,8 @@
         "ext-mbstring" : "*"
     },
     "require-dev" : {
-        "phpunit/phpunit" : "*"
+        "phpunit/phpunit" : "*",
+        "squizlabs/php_codesniffer": "*"
     },
     "authors" : [
         {
diff --git a/tests/phpcs/ruleset.xml b/tests/phpcs/ruleset.xml
new file mode 100644
index 0000000..ce7c0d7
--- /dev/null
+++ b/tests/phpcs/ruleset.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<ruleset name="sabre.php">
+    <description>sabre.io codesniffer ruleset</description>
+
+     <!-- Include the whole PSR-1 standard -->
+     <rule ref="PSR1" />
+
+     <!-- All PHP files MUST use the Unix LF (linefeed) line ending. -->
+     <rule ref="Generic.Files.LineEndings">
+      <properties>
+       <property name="eolChar" value="\n"/>
+      </properties>
+     </rule>
+
+     <!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
+     <rule ref="Zend.Files.ClosingTag"/>
+
+     <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
+     <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
+      <properties>
+       <property name="ignoreBlankLines" value="true"/>
+       </properties>
+   </rule>
+
+   <!-- There MUST NOT be more than one statement per line. -->
+   <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
+
+   <rule ref="Generic.WhiteSpace.ScopeIndent">
+      <properties>
+       <property name="ignoreIndentationTokens" type="array" value="T_COMMENT,T_DOC_COMMENT"/>
+      </properties>
+   </rule>
+   <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
+
+   <!-- PHP keywords MUST be in lower case. -->
+   <rule ref="Generic.PHP.LowerCaseKeyword"/>
+
+   <!-- The PHP constants true, false, and null MUST be in lower case. -->
+   <rule ref="Generic.PHP.LowerCaseConstant"/>
+
+   <rule ref="Squiz.Scope.MethodScope"/>
+   <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
+
+   <!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. -->
+   <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
+    <properties>
+     <property name="equalsSpacing" value="1"/>
+    </properties>
+   </rule>
+   <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
+    <severity>0</severity>
+   </rule>
+
+   <!-- When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis, there MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.
+   Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. -->
+   <rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket">
+     <severity>0</severity>
+    </rule>
+
+   <rule ref="PEAR.Functions.FunctionCallSignature"/>
+   <rule ref="PEAR.Functions.ValidDefaultValue"/>
+   <rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
+</ruleset>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list