Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed coding standards to Drupal. #72

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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