1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/phpcs.xml

130 lines
6.1 KiB
XML
Raw Normal View History

2016-11-02 07:29:00 +01:00
<?xml version="1.0"?>
2021-06-08 04:55:21 +02:00
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
name="Psalm coding standard"
>
<description>The coding standard for Psalm.</description>
<!-- **************************************************************************************************************
* Configuration *
************************************************************************************************************** -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<arg name="basepath" value="."/>
<!-- **************************************************************************************************************
* Files to include/exclude *
************************************************************************************************************** -->
<file>bin/</file>
<file>src/</file>
<file>tests/</file>
<exclude-pattern>src/Psalm/Internal/Visitor/SimpleNameResolver.php</exclude-pattern>
<!-- These are just examples and stub classes/files, so it doesn't really matter if they're PSR-2 compliant. -->
<exclude-pattern>src/Psalm/Internal/Stubs/</exclude-pattern>
<exclude-pattern>tests/fixtures/</exclude-pattern>
<!-- **************************************************************************************************************
* STANDARD: Generic *
************************************************************************************************************** -->
<!--
Restrict line length.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Docs/Files/LineLengthStandard.xml
-->
<rule ref="Generic.Files.LineLength">
<exclude-pattern>tests</exclude-pattern>
<exclude-pattern>src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php</exclude-pattern>
</rule>
<!-- **************************************************************************************************************
* STANDARD: PSR2 *
************************************************************************************************************** -->
<rule ref="PSR2"/>
<!--
Namespace Declarations.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml
-->
<rule ref="PSR2.Namespaces.UseDeclaration">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- **************************************************************************************************************
* STANDARD: Squiz *
************************************************************************************************************** -->
<!--
The self keyword should be used instead of the current class name.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml
-->
<rule ref="Squiz.Classes.SelfMemberReference"/>
<!-- **************************************************************************************************************
* STANDARD: SlevomatCodingStandard *
************************************************************************************************************** -->
<!--
Handle imports from namespaces.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesreferenceusednamesonly-
-->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
2021-12-03 20:29:06 +01:00
<property name="allowFullyQualifiedExceptions" type="bool" value="false"/>
2021-12-03 21:07:25 +01:00
<property name="allowFullyQualifiedGlobalFunctions" type="bool" value="false"/>
2021-12-03 21:25:22 +01:00
<property name="allowFullyQualifiedGlobalConstants" type="bool" value="false"/>
2021-12-03 21:40:18 +01:00
<property name="allowFullyQualifiedGlobalClasses" type="bool" value="false"/>
2021-12-02 17:42:50 +01:00
2021-12-03 22:44:41 +01:00
<property name="allowFullyQualifiedNameForCollidingClasses" type="bool" value="false"/>
<property name="allowFullyQualifiedNameForCollidingFunctions" type="bool" value="false"/>
<property name="allowFullyQualifiedNameForCollidingConstants" type="bool" value="false"/>
2021-12-02 17:42:50 +01:00
2021-12-03 22:44:41 +01:00
<property name="allowFallbackGlobalFunctions" type="bool" value="false"/>
<property name="allowFallbackGlobalConstants" type="bool" value="false"/>
2021-12-02 17:42:50 +01:00
<property name="allowPartialUses" type="bool" value="true"/>
<property name="searchAnnotations" type="bool" value="false"/>
</properties>
</rule>
<!--
Looks for unused imports from other namespaces.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesunuseduses-
-->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
2021-06-08 04:55:21 +02:00
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!--
Checks whether uses at the top of a file are alphabetically sorted.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesalphabeticallysorteduses-
-->
2021-06-08 04:55:21 +02:00
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true"/>
2021-06-08 04:55:21 +02:00
</properties>
</rule>
<!--
Enforces configurable number of lines before/after/between use.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesusespacing-
-->
2021-06-08 04:55:21 +02:00
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBetweenUseTypes" value="1"/>
</properties>
</rule>
</ruleset>