Skip to content

Commit

Permalink
Changed coding standards to Drupal.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Mar 8, 2024
1 parent f49fbc5 commit 4b08cee
Show file tree
Hide file tree
Showing 21 changed files with 3,137 additions and 3,277 deletions.
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
"require": {
"php": ">=8.1",
"cpliakas/git-wrapper": "^3.1",
"monolog/monolog": "^3.5",
"symfony/console": "^6",
"symfony/finder": "^6",
"symfony/filesystem": "^6",
"monolog/monolog": "^3.5"
"symfony/finder": "^6"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"escapestudios/symfony2-coding-standard": "^3",
"drupal/coder": "^8.3",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0.0",
"squizlabs/php_codesniffer": "^3.6"
"rector/rector": "^1.0.0"
},
"autoload": {
"psr-4": {
Expand Down
45 changes: 17 additions & 28 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<description>Custom PHPCS standard.</description>

<!-- Coding standard. -->
<rule ref="Symfony">
<exclude name="Symfony.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="Drupal">
<exclude name="Drupal.Commenting.ClassComment.Short" />
</rule>

<!-- Show sniff codes in all reports -->
Expand All @@ -13,37 +13,26 @@
<arg value="p"/>
<arg name="colors"/>

<!--
PHP_CodeSniffer does not support scanning of files without extensions, so
we have to use the ugly workaround to copy the file into a file with a 'php'
extension, scan that file, and then delete it.
@see https://github.com/squizlabs/PHP_CodeSniffer/issues/2916
-->
<file>src</file>
<file>tests/phpunit</file>

<rule ref="Symfony.Commenting.License.Warning">
<exclude-pattern>*.*</exclude-pattern>
</rule>
<rule ref="Symfony.Functions.Arguments.Invalid">
<exclude-pattern>*.*</exclude-pattern>
</rule>
<rule ref="Symfony.ControlStructure.YodaConditions.Invalid">
<exclude-pattern>*.*</exclude-pattern>
</rule>

<rule ref="PSR1">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<!-- Allow long array lines in tests. -->
<rule ref="Drupal.Arrays.Array.LongLineDeclaration">
<exclude-pattern>*.Test\.php</exclude-pattern>
<exclude-pattern>*.TestCase\.php</exclude-pattern>
<exclude-pattern>*.test</exclude-pattern>
</rule>

<!--Allow uncommented functions in tests as they usually provide enough
information from their names.-->
<rule ref="Symfony.Commenting.FunctionComment.Missing">
<exclude-pattern>tests/*.Test\.php</exclude-pattern>
<exclude-pattern>tests/*.TestCase\.php</exclude-pattern>
<!-- Allow missing function comments in tests. -->
<rule ref="Drupal.Commenting.FunctionComment.Missing">
<exclude-pattern>*.Test\.php</exclude-pattern>
<exclude-pattern>*.TestCase\.php</exclude-pattern>
<exclude-pattern>*.test</exclude-pattern>
</rule>
<rule ref="Symfony.Commenting.FunctionComment.MissingParamTag">
<exclude-pattern>tests/*.Test\.php</exclude-pattern>
<exclude-pattern>tests/*.TestCase\.php</exclude-pattern>
<!-- Allow missing function comment short descriptions in tests. -->
<rule ref="Drupal.Commenting.DocComment.MissingShort">
<exclude-pattern>*.Test\.php</exclude-pattern>
<exclude-pattern>*.TestCase\.php</exclude-pattern>
<exclude-pattern>*.test</exclude-pattern>
</rule>
</ruleset>
Loading

0 comments on commit 4b08cee

Please sign in to comment.