Skip to content

Commit

Permalink
AD-HOC style (*): Added lint configuration
Browse files Browse the repository at this point in the history
Recently, there have been a number of changes in the project. Largely,
this has been refactoring related, and no actual code changes have taken
place. However, it stands to reason that code changes might be
introduced in future.

This commit adds some configuration to assist in sanity checking these
changes to ensure they adhere to known standards, commonly in use across
all sitewards projects.
:
  • Loading branch information
andrewhowdencom committed May 19, 2017
1 parent 5c85e0b commit 01c393b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .arclint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"linters": {
"php": {
"type": "php",
"include": "(\\.(php|phtml)$)"
},
"phpcs": {
"type": "phpcs",
"bin": "phpcs",
"include": "(\\.(php|phtml)$)",
"phpcs.standard": "phpcs.xml"
}
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Changed

- Removed orphaned files from the previous deletion of Netzarbeiter/Customer-Activation, hard coded in the repo. @jhoelzl
- (Dev): Added lints

### Notes

Expand Down
29 changes: 29 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<ruleset name="SitewardsStandard">
<description>Sitewards coding standards.</description>

<ini name="date.timezone" value="Europe/Berlin" />

<rule ref="PSR2" />

<rule ref="PSR1.Classes.ClassDeclaration">
<exclude-pattern>*app/code*</exclude-pattern>
<exclude-pattern>*SitewardsStandard*</exclude-pattern>
</rule>

<rule ref="Squiz.Classes.ValidClassName">
<exclude-pattern>*app/code*</exclude-pattern>
<exclude-pattern>*SitewardsStandard*</exclude-pattern>
</rule>

<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>*app/code*</exclude-pattern>
<exclude-pattern>*SitewardsStandard*</exclude-pattern>
</rule>

<!-- Ensure multiple statements that are sequential are aligned -->
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>

<!-- Ensure there is no superfleus whitespace -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
</ruleset>

0 comments on commit 01c393b

Please sign in to comment.