Skip to content

Commit

Permalink
Merge pull request roots#136 from roots/add-phpcs-and-travis
Browse files Browse the repository at this point in the history
Add PHPCS and Travis
  • Loading branch information
retlehs committed Jan 31, 2015
2 parents 9f8e539 + fd7531f commit c3e425e
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 10 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
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 .
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# [Bedrock](http://roots.io/wordpress-stack/)
[![Build Status](https://travis-ci.org/roots/bedrock.svg)](https://travis-ci.org/roots/bedrock)

Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.

Expand Down Expand Up @@ -233,7 +234,7 @@ Whenever you add a new plugin or update the WP version, run `composer update` to

`!web/app/plugins/plugin-name`

Note: Some plugins may create files or folders outside of their given scope, or even make modifications to `wp-config.php` and other files in the `app` directory. These files should be added to your `.gitignore` file as they are managed by the plugins themselves, which are managed via Composer. Any modifications to `wp-config.php` that are needed should be moved into `config/application.php`.
Note: Some plugins may create files or folders outside of their given scope, or even make modifications to `wp-config.php` and other files in the `app` directory. These files should be added to your `.gitignore` file as they are managed by the plugins themselves, which are managed via Composer. Any modifications to `wp-config.php` that are needed should be moved into `config/application.php`.

#### Updating WP and plugin versions

Expand Down
14 changes: 7 additions & 7 deletions config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
/**
* Authentication Unique Keys and Salts
*/
define('AUTH_KEY', getenv('AUTH_KEY'));
define('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
define('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
define('NONCE_KEY', getenv('NONCE_KEY'));
define('AUTH_SALT', getenv('AUTH_SALT'));
define('AUTH_KEY', getenv('AUTH_KEY'));
define('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
define('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
define('NONCE_KEY', getenv('NONCE_KEY'));
define('AUTH_SALT', getenv('AUTH_SALT'));
define('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
define('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
define('NONCE_SALT', getenv('NONCE_SALT'));
define('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
define('NONCE_SALT', getenv('NONCE_SALT'));

/**
* Custom Settings
Expand Down
27 changes: 27 additions & 0 deletions ruleset.xml
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>
2 changes: 1 addition & 1 deletion web/app/mu-plugins/bedrock-autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Autoloader {
private static $relative_path; // Relative path to the mu-plugins dir.
private static $_single; // Let's make this a singleton.

function __construct() {
public function __construct() {
if (isset(self::$_single)) { return; }

self::$_single = $this; // Singleton set.
Expand Down
3 changes: 2 additions & 1 deletion web/index.php
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');

0 comments on commit c3e425e

Please sign in to comment.