mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add codesniffer that ensures indentation is with tabs.
This commit is contained in:
parent
0f8b229d6b
commit
fc5dd2994c
@ -22,7 +22,8 @@ before_script:
|
||||
|
||||
script:
|
||||
- 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:
|
||||
except:
|
||||
|
@ -408,5 +408,4 @@ class BulkLoader_Result extends Object {
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ function encodeFileForEmail($file, $destFileName = false, $disposition = NULL, $
|
||||
|
||||
$headers = "Content-type: $mimeType;\n\tname=\"$base\"\n".
|
||||
"Content-Transfer-Encoding: $encoding\n".
|
||||
"Content-Disposition: $disposition;\n\tfilename=\"$base\"\n" ;
|
||||
"Content-Disposition: $disposition;\n\tfilename=\"$base\"\n";
|
||||
|
||||
if ( isset($file['contentLocation']) ) $headers .= 'Content-Location: ' . $file['contentLocation'] . "\n" ;
|
||||
|
||||
|
@ -593,7 +593,7 @@ class ComplexTableField_ItemRequest extends TableListField_ItemRequest {
|
||||
if(is_numeric($this->itemID)) {
|
||||
// we have to use the basedataclass, otherwise we might exclude other subclasses
|
||||
return DataObject::get_by_id(
|
||||
ClassInfo::baseDataClass(Object::getCustomClass($this->ctf->sourceClass())), $this->itemID);
|
||||
ClassInfo::baseDataClass(Object::getCustomClass($this->ctf->sourceClass())), $tis->itemID);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -444,7 +444,6 @@ class TableField extends TableListField {
|
||||
|
||||
// TODO ADD stuff for removing rows with incomplete data
|
||||
}
|
||||
|
||||
return $sortedData;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,6 @@
|
||||
this._super();
|
||||
this.selectable('destroy');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -6,15 +6,15 @@
|
||||
* ajax / iframe submissions
|
||||
*/
|
||||
|
||||
var ss = ss || {};
|
||||
var ss = ss || {};
|
||||
/**
|
||||
* Wrapper for HTML WYSIWYG libraries, which abstracts library internals
|
||||
* from interface concerns like inserting and editing links.
|
||||
* Caution: Incomplete and unstable API.
|
||||
*/
|
||||
ss.editorWrappers = {};
|
||||
ss.editorWrappers.initial
|
||||
ss.editorWrappers.tinyMCE = (function() {
|
||||
ss.editorWrappers = {};
|
||||
ss.editorWrappers.initial
|
||||
ss.editorWrappers.tinyMCE = (function() {
|
||||
return {
|
||||
init: function(config) {
|
||||
if(!ss.editorWrappers.tinyMCE.initialized) {
|
||||
|
@ -1936,7 +1936,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* or extended onto it by using {@link DataExtension->updateCMSFields()}.
|
||||
*
|
||||
* <code>
|
||||
* klass MyCustomClass extends DataObject {
|
||||
* class MyCustomClass extends DataObject {
|
||||
* static $db = array('CustomProperty'=>'Boolean');
|
||||
*
|
||||
* function getCMSFields() {
|
||||
|
@ -334,7 +334,7 @@ class DataQuery {
|
||||
*
|
||||
* @param String $field Unquoted database column name (will be escaped automatically)
|
||||
*/
|
||||
public function max($field) {
|
||||
public function max($field) {
|
||||
return $this->aggregate(sprintf('MAX("%s")', Convert::raw2sql($field)));
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,6 @@ class SSHTMLBBCodeParser
|
||||
*/
|
||||
public function addFilter($filter)
|
||||
{
|
||||
|
||||
$filter = ucfirst($filter);
|
||||
if (!array_key_exists($filter, $this->_filters)) {
|
||||
$class = 'SSHTMLBBCodeParser_Filter_'.$filter;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @subpackage tests
|
||||
*/
|
||||
|
||||
class UploadFieldTest extends FunctionalTest {
|
||||
class UploadFieldTest extends FunctionalTest {
|
||||
|
||||
static $fixture_file = 'UploadFieldTest.yml';
|
||||
|
||||
|
@ -60,7 +60,6 @@ class ComponentSetTest_Player extends Member implements TestOnly {
|
||||
static $belongs_many_many = array(
|
||||
'Teams' => 'ComponentSetTest_Team'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
class ComponentSetTest_Team extends DataObject implements TestOnly {
|
||||
|
@ -1143,7 +1143,6 @@ class DataObjectTest_Player extends Member implements TestOnly {
|
||||
static $belongs_many_many = array(
|
||||
'Teams' => 'DataObjectTest_Team'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
class DataObjectTest_Team extends DataObject implements TestOnly {
|
||||
|
18
tests/phpcs/tabs.xml
Normal file
18
tests/phpcs/tabs.xml
Normal 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>
|
||||
|
Loading…
Reference in New Issue
Block a user