Skip to content

Commit 5b22172

Browse files
test(mess detector): Setting PHP Mess Detector tool
1 parent 0f7dbcb commit 5b22172

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"bramus/monolog-colored-line-formatter": "^3.0",
4141
"symfony/var-dumper": "^5.2",
4242
"phpunit/phpunit": "8.5.21",
43-
"clean/phpdoc-md": "^0.19.1"
43+
"clean/phpdoc-md": "^0.19.1",
44+
"phpmd/phpmd": "@stable"
4445
}
4546
}

docs/ddev.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,13 @@ And then:
235235
```
236236
ddev exec PHP_CS_FIXER_IGNORE_ENV=1 ./my-own-modules/crowdsec-php-lib/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix ./my-own-modules/crowdsec-php-lib
237237
238+
```
239+
240+
#### PHP Mess Detector
241+
242+
To use the `phpmd` tool, you can run:
243+
244+
```
245+
ddev phpmd ./my-own-modules/crowdsec-php-lib tools/phpmd/rulesets.xml src
246+
238247
```

tools/phpmd/rulesets.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="CrowdSec PHP Lib rule set"
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
6+
http://pmd.sf.net/ruleset_xml_schema.xsd"
7+
xsi:noNamespaceSchemaLocation="
8+
http://pmd.sf.net/ruleset_xml_schema.xsd">
9+
<description>
10+
Rule set that checks CrowdSec PHP lib
11+
</description>
12+
13+
<rule ref="rulesets/codesize.xml" />
14+
<rule ref="rulesets/cleancode.xml" />
15+
<rule ref="rulesets/unusedcode.xml" />
16+
</ruleset>

0 commit comments

Comments
 (0)