-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added phpcs config file, useful for moodle-plugin-ci own style
Note that this is the config that I was using here since ages ago and it aligns 99% with the moodle-cs one. Basically, it's PSR12 with a few customisations.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset> | ||
<description>The coding rules configuration for the moodle-plugin-ci project.</description> | ||
|
||
<!-- By default, we want to check the src and tests directories --> | ||
<file>./src</file> | ||
<file>./tests</file> | ||
|
||
<!-- We don't want to analyse these --> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
<exclude-pattern>*/moodle/*</exclude-pattern> | ||
<exclude-pattern>*/tests/Fixture/*</exclude-pattern> | ||
<exclude-pattern>*/tests/*/Fixture/*</exclude-pattern> | ||
|
||
<!-- PSR12 with a few exceptions and adjustments --> | ||
<rule ref="PSR12"> | ||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/> | ||
</rule> | ||
|
||
<!-- Some more chars don't hurt too much --> | ||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="132"/> | ||
<property name="absoluteLineLimit" value="180"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- We want to enforce && and || instead of and and or --> | ||
<rule ref="Squiz.Operators.ValidLogicalOperators"/> | ||
|
||
<!-- We want to use always the short array syntax --> | ||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/> | ||
|
||
<!-- We want better commas managing --> | ||
<!-- Space after comma --> | ||
<rule ref="moodle.WhiteSpace.SpaceAfterComma"/> | ||
<!-- Comma at the end of multi-line arrays --> | ||
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"> | ||
<exclude name="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine" /> | ||
</rule> | ||
|
||
<!--PHPCompatibility configuration--> | ||
<rule ref="./vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml"/> | ||
<config name="testVersion" value="8.1-"/> | ||
</ruleset> |