mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 13:03:52 +03:00
Merge pull request #290 from acelaya/feature/coding-standard
Updated project to use external coding standard
This commit is contained in:
commit
03ee46d903
3 changed files with 7 additions and 45 deletions
|
@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
* [#267](https://github.com/shlinkio/shlink/issues/267) API responses and the CLI interface is no longer translated and uses english always. Only not found error templates are still translated.
|
* [#267](https://github.com/shlinkio/shlink/issues/267) API responses and the CLI interface is no longer translated and uses english always. Only not found error templates are still translated.
|
||||||
|
* [#289](https://github.com/shlinkio/shlink/issues/289) Extracted coding standard rules to a separated package.
|
||||||
|
|
||||||
#### Deprecated
|
#### Deprecated
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,7 @@
|
||||||
"phpstan/phpstan": "^0.10.0",
|
"phpstan/phpstan": "^0.10.0",
|
||||||
"phpunit/phpcov": "^5.0",
|
"phpunit/phpcov": "^5.0",
|
||||||
"phpunit/phpunit": "^7.3",
|
"phpunit/phpunit": "^7.3",
|
||||||
"slevomat/coding-standard": "^4.0",
|
"shlinkio/php-coding-standard": "~1.0.0",
|
||||||
"squizlabs/php_codesniffer": "^3.2.3",
|
|
||||||
"symfony/dotenv": "^4.0",
|
"symfony/dotenv": "^4.0",
|
||||||
"symfony/var-dumper": "^4.0",
|
"symfony/var-dumper": "^4.0",
|
||||||
"zendframework/zend-component-installer": "^2.1",
|
"zendframework/zend-component-installer": "^2.1",
|
||||||
|
|
48
phpcs.xml
48
phpcs.xml
|
@ -1,53 +1,13 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<ruleset name="Coding standard">
|
<ruleset name="Coding standard">
|
||||||
<description>Coding standard</description>
|
<description>Coding standard</description>
|
||||||
<config name="installed_paths" value="../../slevomat/coding-standard"/>
|
|
||||||
|
|
||||||
<!-- display progress -->
|
<!-- display progress -->
|
||||||
<arg value="p"/>
|
<arg value="p" />
|
||||||
<arg name="colors"/>
|
<arg name="colors" />
|
||||||
|
|
||||||
<!-- inherit rules from: -->
|
<!-- inherit rules from: -->
|
||||||
<rule ref="PSR2"/>
|
<rule ref="Shlinkio" />
|
||||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
|
||||||
<!-- Make sure string concatenations use 1 space between every element -->
|
|
||||||
<rule ref="Squiz.Strings.ConcatenationSpacing">
|
|
||||||
<properties>
|
|
||||||
<property name="spacing" value="1"/>
|
|
||||||
<property name="ignoreNewlines" value="true"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
|
||||||
<properties>
|
|
||||||
<property name="ignoreBlankLines" value="false"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
|
|
||||||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
|
|
||||||
<properties>
|
|
||||||
<property name="newlinesCountBetweenOpenTagAndDeclare" value="1"/>
|
|
||||||
<property name="spacesCountAroundEqualsSign" value="0"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
|
|
||||||
<properties>
|
|
||||||
<property name="searchAnnotations" value="true"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
<!-- Force strict comparison with === or !== instead of == or != -->
|
|
||||||
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/>
|
|
||||||
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
|
|
||||||
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
|
|
||||||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
|
|
||||||
<!-- Enforce all global namespace classes, functions and constants to be explicitly imported -->
|
|
||||||
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
|
|
||||||
<properties>
|
|
||||||
<property name="allowFallbackGlobalFunctions" value="false"/>
|
|
||||||
<property name="allowFallbackGlobalConstants" value="false"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
<!-- Require comments with single line written as one-liners -->
|
|
||||||
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/>
|
|
||||||
|
|
||||||
<!-- Paths to check -->
|
<!-- Paths to check -->
|
||||||
<file>bin</file>
|
<file>bin</file>
|
||||||
|
@ -55,6 +15,8 @@
|
||||||
<file>data/migrations</file>
|
<file>data/migrations</file>
|
||||||
<file>config</file>
|
<file>config</file>
|
||||||
<file>public/index.php</file>
|
<file>public/index.php</file>
|
||||||
|
|
||||||
|
<!-- Paths to exclude -->
|
||||||
<exclude-pattern>config/params/*</exclude-pattern>
|
<exclude-pattern>config/params/*</exclude-pattern>
|
||||||
<exclude-pattern>public/index.php</exclude-pattern>
|
<exclude-pattern>public/index.php</exclude-pattern>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|
Loading…
Add table
Reference in a new issue