Add codesniffer that ensures indentation is with tabs.

This commit is contained in:
Simon Welsh 2012-12-09 00:20:20 +13:00
parent 379b561cdb
commit d795b191ec
107 changed files with 2937 additions and 2923 deletions

View File

@ -22,7 +22,8 @@ before_script:
script: script:
- phpunit -c phpunit.xml.dist - phpunit -c phpunit.xml.dist
- phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs -np framework - phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs/ruleset.xml -np framework
- phpcs --encoding=utf-8 --standard=framework/tests/phpcs/tabs.xml -np framework
branches: branches:
except: except:

View File

@ -408,5 +408,4 @@ class BulkLoader_Result extends Object {
return $set; return $set;
} }
} }

View File

@ -244,7 +244,6 @@
this._super(); this._super();
this.selectable('destroy'); this.selectable('destroy');
} }
}); });
/** /**

View File

@ -6,15 +6,15 @@
* ajax / iframe submissions * ajax / iframe submissions
*/ */
var ss = ss || {}; var ss = ss || {};
/** /**
* Wrapper for HTML WYSIWYG libraries, which abstracts library internals * Wrapper for HTML WYSIWYG libraries, which abstracts library internals
* from interface concerns like inserting and editing links. * from interface concerns like inserting and editing links.
* Caution: Incomplete and unstable API. * Caution: Incomplete and unstable API.
*/ */
ss.editorWrappers = {}; ss.editorWrappers = {};
ss.editorWrappers.initial ss.editorWrappers.initial
ss.editorWrappers.tinyMCE = (function() { ss.editorWrappers.tinyMCE = (function() {
return { return {
init: function(config) { init: function(config) {
if(!ss.editorWrappers.tinyMCE.initialized) { if(!ss.editorWrappers.tinyMCE.initialized) {

View File

@ -1960,7 +1960,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* or extended onto it by using {@link DataExtension->updateCMSFields()}. * or extended onto it by using {@link DataExtension->updateCMSFields()}.
* *
* <code> * <code>
* klass MyCustomClass extends DataObject { * class MyCustomClass extends DataObject {
* static $db = array('CustomProperty'=>'Boolean'); * static $db = array('CustomProperty'=>'Boolean');
* *
* function getCMSFields() { * function getCMSFields() {

View File

@ -209,7 +209,6 @@ class SSHTMLBBCodeParser
*/ */
public function addFilter($filter) public function addFilter($filter)
{ {
$filter = ucfirst($filter); $filter = ucfirst($filter);
if (!array_key_exists($filter, $this->_filters)) { if (!array_key_exists($filter, $this->_filters)) {
$class = 'SSHTMLBBCodeParser_Filter_'.$filter; $class = 'SSHTMLBBCodeParser_Filter_'.$filter;

View File

@ -4,7 +4,7 @@
* @subpackage tests * @subpackage tests
*/ */
class UploadFieldTest extends FunctionalTest { class UploadFieldTest extends FunctionalTest {
static $fixture_file = 'UploadFieldTest.yml'; static $fixture_file = 'UploadFieldTest.yml';

View File

@ -60,7 +60,6 @@ class ComponentSetTest_Player extends Member implements TestOnly {
static $belongs_many_many = array( static $belongs_many_many = array(
'Teams' => 'ComponentSetTest_Team' 'Teams' => 'ComponentSetTest_Team'
); );
} }
class ComponentSetTest_Team extends DataObject implements TestOnly { class ComponentSetTest_Team extends DataObject implements TestOnly {

View File

@ -1125,7 +1125,6 @@ class DataObjectTest_Player extends Member implements TestOnly {
static $belongs_many_many = array( static $belongs_many_many = array(
'Teams' => 'DataObjectTest_Team' 'Teams' => 'DataObjectTest_Team'
); );
} }
class DataObjectTest_Team extends DataObject implements TestOnly { class DataObjectTest_Team extends DataObject implements TestOnly {

18
tests/phpcs/tabs.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe.Tabs">
<description>CodeSniffer ruleset for SilverStripe indentation conventions.</description>
<!-- exclude SCSS-generated CSS files -->
<exclude-pattern>*/css/*</exclude-pattern>
<exclude-pattern>css/*</exclude-pattern>
<!-- exclude thirdparty content -->
<exclude-pattern>thirdparty/*</exclude-pattern>
<exclude-pattern>*/jquery-changetracker/*</exclude-pattern>
<exclude-pattern>parsers/HTML/BBCodeParser/*</exclude-pattern>
<!-- PHP-PEG generated file not intended for human consumption -->
<exclude-pattern>*/SSTemplateParser.php$</exclude-pattern>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
</ruleset>