Skip to content

Commit

Permalink
Merge pull request #176 from ResponsiveImagesCG/linthub-config
Browse files Browse the repository at this point in the history
Add Linthub config
  • Loading branch information
joemcgill committed Sep 19, 2015
2 parents 3e97142 + b51e2df commit 057bd7b
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,

"browser": true,

"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"JSON": false,
"wp": false
}
}
16 changes: 16 additions & 0 deletions .linthub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
go:
lint: false
php:
lint: true
config: ruleset.xml
java:
lint: false
scala:
lint: false
shell:
lint: false
css:
lint: true
js:
lint: jshint # jshint (default) | eslint | false
config: .jshintrc
88 changes: 88 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0"?>
<ruleset name="WordPress Core">
<description>Non-controversial generally-agreed upon WordPress Coding Standards</description>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#brace-style -->
<rule ref="Generic.ControlStructures.InlineControlStructure" />
<rule ref="Squiz.ControlStructures.ControlSignature" />
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
<severity>0</severity>
</rule>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#remove-trailing-spaces -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#no-shorthand-php-tags -->
<rule ref="Generic.PHP.DisallowShortOpenTag"/>

<!-- important to prevent issues with content being sent before headers -->
<rule ref="Generic.Files.ByteOrderMark"/>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#naming-conventions -->
<rule ref="Generic.PHP.LowerCaseConstant"/>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#indentation -->
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>

<!-- http://make.wordpress.org/core/handbook/coding-standards/php/#error-control-operator -->
<rule ref="Generic.PHP.NoSilencedErrors" />

<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<severity>0</severity>
</rule>

<rule ref="Generic.PHP.LowerCaseKeyword"/>

<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>


<rule ref="Generic.Files.EndFileNewline"/>

<!-- https://make.wordpress.org/core/handbook/coding-standards/php/#naming-conventions -->
<rule ref="Generic.Files.LowercasedFilename"/>

<!-- https://make.wordpress.org/core/handbook/coding-standards/php/#space-usage -->
<rule ref="Generic.Formatting.SpaceAfterCast"/>

<!-- https://make.wordpress.org/core/handbook/coding-standards/php/#brace-style -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>

<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="requiredSpacesAfterOpen" value="1" />
<property name="requiredSpacesBeforeClose" value="1" />
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>

<rule ref="WordPress.Arrays.ArrayDeclaration">
<exclude name="WordPress.Arrays.ArrayDeclaration.SingleLineNotAllowed" />
</rule>
<rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions"/>
<rule ref="WordPress.Classes.ValidClassName"/>
<rule ref="WordPress.Files.FileName"/>
<rule ref="WordPress.Functions.FunctionDeclarationArgumentSpacing"/>
<rule ref="WordPress.NamingConventions.ValidFunctionName"/>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"/>
<rule ref="WordPress.WhiteSpace.OperatorSpacing"/>
<rule ref="WordPress.WhiteSpace.CastStructureSpacing"/>
<rule ref="WordPress.PHP.YodaConditions"/>

</ruleset>

0 comments on commit 057bd7b

Please sign in to comment.