Permalink
Browse files

Release version 0.2

  • Loading branch information...
2 parents 0e00f50 + 28ec6a0 commit 5cbecdfce7f238c59d3eeb12fd5d4457e1b05c30 @shadowhand shadowhand committed May 27, 2014
Showing with 53 additions and 82 deletions.
  1. 0 {PHP/CodeSniffer/Standards → }/Kohana/KohanaCodingStandard.php
  2. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Classes/EmptyConstructorCallSniff.php
  3. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Commenting/DocBlockParamSniff.php
  4. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Commenting/DocBlockSeeSniff.php
  5. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Commenting/OneLineCommentSniff.php
  6. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/ControlStructures/ElseIfSniff.php
  7. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/ControlStructures/SingleLineIfSniff.php
  8. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/ControlStructures/SwitchSniff.php
  9. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Functions/RegularExpressionSniff.php
  10. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php
  11. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/NamingConventions/ValidFunctionNameSniff.php
  12. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/NamingConventions/ValidVariableNameSniff.php
  13. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Operators/ComparisonOperatorSniff.php
  14. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Operators/TernaryOperatorSniff.php
  15. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/Operators/TypeCastingSniff.php
  16. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/WhiteSpace/NoConcatenationSpaceSniff.php
  17. 0 {PHP/CodeSniffer/Standards → }/Kohana/Sniffs/WhiteSpace/ParenthesesSniff.php
  18. 0 {PHP/CodeSniffer/Standards → }/Kohana/ruleset.xml
  19. +29 −11 README.md
  20. +0 −71 build.xml
  21. +24 −0 composer.json
File renamed without changes.
View
@@ -7,33 +7,51 @@ These tests are meant to be a guide and may not be 100% accurate. If you find a
## Requirements
-These tests require [PHP Codesniffer](http://pear.php.net/PHP_CodeSniffer)
+These tests are built for usage with [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer).
-## Installation - PEAR (recommended)
+## Installation - Composer
-Standard PEAR install:
+Add the package to the development dependencies in your project's composer.json
- sudo pear channel-discover pear.kohanaframework.org
- sudo pear install kohana/PHP_CodeSniffer_Standards_Kohana
+ {
+ "require-dev": {
+ "kohana/coding-standards": "*",
+ }
+ }
-## Installation - If you intened to make changes to the sniff's
+Run `composer --dev update` to update your composer.lock file and install the package. The sniffs will be installed in
+`vendor/kohana/coding-standards` in your project root directory and the `phpcs` command will be installed to `bin/phpcs`.
+
+## Installation - Manually or with PEAR
If you want the standard to be available system wide you can symlink them into the code sniffer dir like so:
git clone https://github.com/kohana/coding-standards.git kohana-coding-standards
cd kohana-coding-standards
- sudo ln -sfn `pwd`/PHP/CodeSniffer/Standards/Kohana `pear config-get php_dir`/PHP/CodeSniffer/Standards/Kohana
+ sudo ln -sfn `pwd`/Kohana `pear config-get php_dir`/PHP/CodeSniffer/Standards/Kohana
sudo ln -sfn `pwd`/test/PHP_CodeSniffer/CodeSniffer/Standards/Kohana `pear config-get test_dir`/PHP_CodeSniffer/CodeSniffer/Standards/Kohana
## Running
-You can reference the standard like so:
+If you installed with composer, reference the standard from your vendor directory:
+
+ bin/phpcs --standard=vendor/kohana/coding-standards/Kohana modules/
+
+Or, from a raw clone, you can simply reference the local copy:
+
+ phpcs --standard=path/to/coding-standards/Kohana kohana/core
+
+If installed globally (symlinked into PEAR), you can reference the standard like so:
- phpcs --standard=Kohana system/classes/kohana
+ phpcs --standard=Kohana application/
-Or, if you don't want to install it system wide you can simply reference the local copy
+## Customising your project standard
- phpcs --standard=path/to/coding-standard/PHP/CodeSniffer/Standards/Kohana system/classes/kohana
+It is also possible to extend the rules in use for your project, or to include some but not all of the Kohana standards
+(for example, if you are working on something that is not intended as a kohana module). You do this by adding a
+`coding_standard.xml` to your project root which specifies which rules to include and customises any variables. See the
+[PHP_CodeSniffer docs](https://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php) for more
+details.
## Testing
View
@@ -1,71 +0,0 @@
-<?xml version="1.0" ?>
-<project name="kohana-coding-standards" basedir="." default="dist">
- <property name="version" value="1.0.${env.BUILD_NUMBER}" />
-
- <target name="clean">
- <echo>Cleaning...</echo>
- <delete file="*.tgz"/>
- <delete file="package.xml"/>
- </target>
-
- <!-- pear-package Create a PEAR package.xml which will guide the installation. -->
- <target name="dist" depends="clean">
- <echo>Creating PEAR package.xml...</echo>
- <pearpkg2 name="PHP_CodeSniffer_Standards_Kohana" dir="${project.basedir}">
- <option name="outputdirectory" value="${project.basedir}"/>
- <option name="packagefile" value="package.xml"/>
- <option name="packagedirectory" value="${project.basedir}"/>
- <option name="channel" value="pear.kohanaframework.org"/>
- <option name="summary" value="Kohana PHP_CodeSniffer standard"/>
- <option name="description" value="Kohana PHP_CodeSniffer standard"/>
- <option name="notes" value="Kohana PHP_CodeSniffer standard"/>
- <option name="apiversion" value="${version}"/>
- <option name="apistability" value="stable"/>
- <option name="releaseversion" value="${version}"/>
- <option name="releasestability" value="stable"/>
- <option name="license" value="BSD"/>
- <option name="phpdep" value="5.0.0"/>
- <option name="pearinstallerdep" value="1.4.6"/>
- <option name="packagetype" value="php"/>
- <option name="baseinstalldir" value="."/>
- <mapping name="maintainers">
- <element>
- <element key="handle" value="kohana-develoepers"/>
- <element key="name" value="Kohana Developers"/>
- <element key="email" value="developers@kohanaframework.org"/>
- <element key="role" value="lead"/>
- </element>
- </mapping>
- <mapping name="deps">
- <element>
- <element key="channel" value="pear" />
- <element key="name" value="PHP_CodeSniffer" />
- <element key="version" value="1.2.2" />
- <element key="max" value="1.2.2" />
- <element key="recommended" value="1.2.2" />
- </element>
- </mapping>
- <!--<mapping name="role">
- <element>
- <element key="extension" value="xml" />
- <element key="role" value="php" />
- </element>
- </mapping>-->
- <fileset dir="${project.basedir}">
- <include name="PHP/**/*" />
- </fileset>
- </pearpkg2>
-
- <echo>Creating tgz package...</echo>
- <mkdir dir="PHP_CodeSniffer_Standards_Kohana-${version}" />
- <move file="PHP" tofile="PHP_CodeSniffer_Standards_Kohana-${version}/PHP" />
- <tar compression="gzip" destFile="PHP_CodeSniffer_Standards_Kohana-${version}.tgz">
- <fileset dir=".">
- <include name="PHP_CodeSniffer_Standards_Kohana-${version}"/>
- <include name="package.xml"/>
- <include name="*.md" />
- <exclude name=".git"/>
- </fileset>
- </tar>
- </target>
-</project>
View
@@ -0,0 +1,24 @@
+{
+ "name": "kohana/coding-standards",
+ "type": "library",
+ "description": "PHP_CodeSniffer rules for the Kohana Framework coding style",
+ "keywords": ["kohana", "code standard", "coding stanards", "code style", "standards", "phpcs"],
+ "homepage": "https://github.com/kohana/coding-standards",
+ "license": "BSD-3-Clause",
+ "support": {
+ "issues": "https://github.com/kohana/coding-standards/issues",
+ "wiki": "https://github.com/kohana/coding-standards/wiki",
+ "irc": "irc://irc.freenode.org/kohana"
+ },
+ "authors": [
+ {
+ "name": "Kohana Team",
+ "email": "team@kohanaframework.org",
+ "homepage": "http://www.kohanaframework.org",
+ "role": "Maintainer"
+ }
+ ],
+ "require": {
+ "squizlabs/php_codesniffer": "1.*"
+ }
+}

0 comments on commit 5cbecdf

Please sign in to comment.