Skip to content

Commit f2b9b7d

Browse files
authored
Added ddev command shortcuts (#2868)
1 parent 3dcbdca commit f2b9b7d

File tree

7 files changed

+86
-46
lines changed

7 files changed

+86
-46
lines changed

.ddev/commands/web/php-cs-fixer

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: run PHP-CS-Fixer
4+
## Usage: php-cs-fixer
5+
## Example: ddev php-cs-fixer <path-to-files>
6+
7+
php vendor/bin/php-cs-fixer fix "$@"

.ddev/commands/web/phpcbf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: run PHPCodeBeautifier
4+
## Usage: phpcbf
5+
## Example: ddev phpcbf <path-to-files>
6+
7+
php vendor/bin/phpcbf -s -p --report=full,source,summary "$@"

.ddev/commands/web/phpcs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: run PHPCodeSniffer
4+
## Usage: phpcs
5+
## Example: ddev phpcs <path-to-files>
6+
7+
php vendor/bin/phpcs -s -p --report=full,summary "$@"

.ddev/commands/web/phpmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: run PHPMD
4+
## Usage: phpmd
5+
## Example: ddev phpmd <path-to-files>
6+
7+
php vendor/bin/phpmd "$@" text .phpmd.dist.xml

.ddev/commands/web/phpstan

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: run PHPStan
4+
## Usage: phpstan
5+
## Example: ddev phpstan <path-to-files>
6+
7+
XDEBUG_MODE=off php vendor/bin/phpstan analyze "$@"

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,3 +623,7 @@
623623
- dev/sonar*
624624
- .github/workflows/phpunit.yml
625625
- .github/workflows/sonar.yml
626+
627+
'ddev':
628+
- .ddev/*
629+
- .ddev/**/*

.phpmd.dist.xml

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset name="Custom ruleset"
2+
<ruleset name="OpenMage ruleset"
33
xmlns="http://pmd.sf.net/ruleset/1.0.0"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
@@ -9,22 +9,22 @@
99
</description>
1010

1111
<!-- UNUSEDCODE
12-
UnusedFormalParameter [fixed]
13-
UnusedLocalVariable
14-
UnusedPrivateField
15-
UnusedPrivateMethod
12+
[?] UnusedFormalParameter
13+
[x] UnusedLocalVariable
14+
[x] UnusedPrivateField
15+
[x] UnusedPrivateMethod
1616
-->
1717
<rule ref="rulesets/unusedcode.xml" />
1818

1919
<!-- CLEANCODE
20-
BooleanArgumentFlag
21-
ElseExpression
22-
ErrorControlOperator
23-
DuplicatedArrayKey
24-
IfStatementAssignment
25-
MissingImport
26-
StaticAccess
27-
UndefinedVariable
20+
[-] BooleanArgumentFlag
21+
[?] ElseExpression
22+
[?] ErrorControlOperator
23+
[x] DuplicatedArrayKey
24+
[ ] IfStatementAssignment
25+
[?] MissingImport
26+
[-] StaticAccess
27+
[?] UndefinedVariable
2828
-->
2929
<rule ref="rulesets/cleancode.xml">
3030
<exclude name="BooleanArgumentFlag" />
@@ -41,12 +41,12 @@
4141
</rule>
4242

4343
<!-- CONTROVERSIAL
44-
CamelCaseClassName
45-
CamelCaseMethodName
46-
CamelCaseParameterName
47-
CamelCasePropertyName
48-
CamelCaseVariableName
49-
Superglobals
44+
[ ] CamelCaseClassName
45+
[ ] CamelCaseMethodName
46+
[ ] CamelCaseParameterName
47+
[ ] CamelCasePropertyName
48+
[ ] CamelCaseVariableName
49+
[x] Superglobals
5050
-->
5151
<rule ref="rulesets/controversial.xml/CamelCaseMethodName">
5252
<properties>
@@ -67,31 +67,32 @@
6767
<rule ref="rulesets/controversial.xml/Superglobals" />
6868

6969
<!-- NAMEING
70-
BooleanGetMethodName
71-
ConstantNamingConventions
72-
ConstructorWithNameAsEnclosingClass
73-
LongClassName
74-
ShortClassName
75-
LongVariable
76-
ShortVariable
77-
ShortMethodName
70+
[ ] BooleanGetMethodName
71+
[ ] ConstantNamingConventions
72+
[ ] ConstructorWithNameAsEnclosingClass
73+
[ ] LongClassName
74+
[ ] ShortClassName
75+
[ ] LongVariable
76+
[?] ShortVariable
77+
[ ] ShortMethodName
7878
-->
7979
<rule ref="rulesets/naming.xml/ShortVariable">
8080
<properties>
8181
<property name="exceptions" value="a,b,e,id,idx,io,ip,to,x,y,x1,x2,y1,y2" />
8282
</properties>
8383
</rule>
84+
<rule ref="rulesets/naming.xml/ShortMethodName" />
8485

8586
<!-- DESIGN
86-
CountInLoopExpression
87-
CouplingBetweenObjects
88-
DepthOfInheritance
89-
DevelopmentCodeFragment
90-
EmptyCatchBlock
91-
EvalExpression
92-
ExitExpression
93-
GotoStatement
94-
NumberOfChildren
87+
[-] CountInLoopExpression
88+
[x] CouplingBetweenObjects
89+
[-] DepthOfInheritance
90+
[x] DevelopmentCodeFragment
91+
[x] EmptyCatchBlock
92+
[x] EvalExpression
93+
[x] ExitExpression
94+
[x] GotoStatement
95+
[-] NumberOfChildren
9596
-->
9697
<rule ref="rulesets/design.xml">
9798
<exclude name="CouplingBetweenObjects" />
@@ -100,16 +101,16 @@
100101
</rule>
101102

102103
<!-- CODESIZE
103-
ExcessiveClassComplexity
104-
ExcessiveClassLength
105-
ExcessiveMethodLength
106-
ExcessiveParameterList
107-
ExcessivePublicCount
108-
CyclomaticComplexity
109-
NPathComplexity
110-
TooManyFields
111-
TooManyMethods
112-
TooManyPublicMethods
104+
[-] ExcessiveClassComplexity
105+
[-] ExcessiveClassLength
106+
[-] ExcessiveMethodLength
107+
[-] ExcessiveParameterList
108+
[-] ExcessivePublicCount
109+
[-] CyclomaticComplexity
110+
[-] NPathComplexity
111+
[-] TooManyFields
112+
[-] TooManyMethods
113+
[-] TooManyPublicMethods
113114
-->
114115
<rule ref="rulesets/codesize.xml">
115116
<exclude name="CyclomaticComplexity" />

0 commit comments

Comments
 (0)