|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset name="Tighten"> |
| 3 | + <!-- |
| 4 | + The name attribute of the ruleset tag is displayed |
| 5 | + when running PHP_CodeSniffer with the -v command line |
| 6 | + argument. The description tag below is not displayed anywhere |
| 7 | + except in this file, so it can contain information for |
| 8 | + developers who may change this file in the future. |
| 9 | + --> |
| 10 | + <description>Tighten's Laravel Coding Standards</description> |
| 11 | + |
| 12 | + <!-- |
| 13 | + If no files or directories are specified on the command line |
| 14 | + your custom standard can specify what files should be checked |
| 15 | + instead. |
| 16 | +
|
| 17 | + Note that specifying any file or directory path |
| 18 | + on the command line will ignore all file tags. |
| 19 | + --> |
| 20 | + <file>app</file> |
| 21 | + <file>config</file> |
| 22 | + <file>tests</file> |
| 23 | + |
| 24 | + <!-- |
| 25 | + You can hard-code ignore patterns directly into your |
| 26 | + custom standard so you don't have to specify the |
| 27 | + patterns on the command line. |
| 28 | + --> |
| 29 | + <exclude-pattern>*/cache/*</exclude-pattern> |
| 30 | + <exclude-pattern>*/*.js</exclude-pattern> |
| 31 | + <exclude-pattern>*/*.css</exclude-pattern> |
| 32 | + <exclude-pattern>*/*.xml</exclude-pattern> |
| 33 | + <exclude-pattern>*/*.blade.php</exclude-pattern> |
| 34 | + <exclude-pattern>*/autoload.php</exclude-pattern> |
| 35 | + <exclude-pattern>*/docs/*</exclude-pattern> |
| 36 | + <exclude-pattern>*/vendor/*</exclude-pattern> |
| 37 | + |
| 38 | + <!-- |
| 39 | + You can hard-code command line values into your custom standard. |
| 40 | + Note that this does not work for the command line values: |
| 41 | + -v[v][v], -l, -d, -sniffs and -standard |
| 42 | + --> |
| 43 | + <arg name="colors"/> |
| 44 | + <arg value="p"/> |
| 45 | + |
| 46 | + <!-- |
| 47 | + You can hard-code custom php.ini settings into your custom standard. |
| 48 | + The following tag sets the memory limit to 64M. |
| 49 | + --> |
| 50 | + <ini name="memory_limit" value="128M"/> |
| 51 | + |
| 52 | + <!-- |
| 53 | + Include all sniffs in the PSR2 standard. Note that the |
| 54 | + path to the standard does not have to be specified as the |
| 55 | + PSR2 standard exists inside the PHP_CodeSniffer install |
| 56 | + directory. |
| 57 | + --> |
| 58 | + <rule ref="PSR2"/> |
| 59 | + |
| 60 | + <!-- Disable missing namespace rule for tests and database files --> |
| 61 | + <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> |
| 62 | + <exclude-pattern>*/database/*</exclude-pattern> |
| 63 | + <exclude-pattern>*/tests/*</exclude-pattern> |
| 64 | + </rule> |
| 65 | + <!-- Disable camel caps rule for tests --> |
| 66 | + <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> |
| 67 | + <exclude-pattern>*/tests/*</exclude-pattern> |
| 68 | + </rule> |
| 69 | + <!-- Disable method visibility rule for tests --> |
| 70 | + <rule ref="Squiz.Scope.MethodScope"> |
| 71 | + <exclude-pattern>*/tests/*</exclude-pattern> |
| 72 | + </rule> |
| 73 | + <!-- Make the soft line length warning silent --> |
| 74 | + <!-- |
| 75 | + <rule ref="Generic.Files.LineLength.TooLong"> |
| 76 | + <severity>0</severity> |
| 77 | + </rule> |
| 78 | + --> |
| 79 | + |
| 80 | + <!-- Enable some extra rules --> |
| 81 | + <!-- Force [] short array syntax --> |
| 82 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax.Found"/> |
| 83 | + <!-- Enforce 1 space around concatenation operators --> |
| 84 | + <rule ref="Squiz.Strings.ConcatenationSpacing"> |
| 85 | + <properties> |
| 86 | + <property name="spacing" value="1" /> |
| 87 | + </properties> |
| 88 | + </rule> |
| 89 | + <!-- Warn when double quotes are used over single quotes --> |
| 90 | + <rule ref="Squiz.Strings.DoubleQuoteUsage"/> |
| 91 | + <!-- Except when the double quotes contain a variable --> |
| 92 | + <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> |
| 93 | + <severity>0</severity> |
| 94 | + </rule> |
| 95 | + |
| 96 | + <!-- Class name should match the file name --> |
| 97 | + <rule ref="Squiz.Classes.ClassFileName"/> |
| 98 | + |
| 99 | + <!-- Expect one space after NOT (!) operator --> |
| 100 | + <rule ref="Generic.Formatting.SpaceAfterNot"/> |
| 101 | +</ruleset> |
| 102 | + |
0 commit comments