forked from roots/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request roots#136 from roots/add-phpcs-and-travis
Add PHPCS and Travis
- Loading branch information
Showing
6 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo: false | ||
language: php | ||
php: | ||
- '5.6' | ||
- '5.5' | ||
- '5.4' | ||
|
||
before_install: | ||
- pyrus install pear/PHP_CodeSniffer | ||
- phpenv rehash | ||
|
||
script: | ||
- phpcs --standard=ruleset.xml --extensions=php --ignore=web/wp/,vendor/ -n -s . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Roots"> | ||
<description>Roots Coding Standards</description> | ||
|
||
<!-- Use PSR-2 as a base --> | ||
<rule ref="PSR2"> | ||
<!-- Allow opening and closing braces for functions and classes to be on the same line --> | ||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/> | ||
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/> | ||
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace"/> | ||
|
||
<!-- Disable newline after opening brace --> | ||
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> | ||
|
||
<!-- Disable PSR-2 indentation rules that are buggy with 2 spaces --> | ||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"/> | ||
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/> | ||
</rule> | ||
|
||
<!-- Force 2 spaces indentation --> | ||
<rule ref="Generic.WhiteSpace.ScopeIndent"> | ||
<properties> | ||
<property name="indent" value="2"/> | ||
<property name="tabIndent" value="false"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
// WordPress view bootstrapper | ||
define('WP_USE_THEMES', true); | ||
require(dirname( __FILE__ ) . '/wp/wp-blog-header.php'); | ||
require(dirname(__FILE__) . '/wp/wp-blog-header.php'); |