Commit f522b071 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Initial commit.

No related merge requests found
Showing with 141 additions and 0 deletions
+141 -0
.gitignore 0 → 100644
/vendor/
LICENSE 0 → 100644
Copyright (c) 2019 Irstea
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
README.md 0 → 100644
# irstea/phpmd-config
Jeux de règles pour [PHP Mess Detector](https://phpmd.org/).
### Installation
```shell
composer require --dev irstea/phpmd-config
```
### Configuration
Le package fournit plusieurs jeux de règles :
- `loose` : pour des projets existants.
- `strict` : recommandé pour les nouveaux projets.
Le jeu sélectionné doit être référencé dans la configuration de PHPMD :
```xml
<ruleset>
<!-- ... -->
<rule ref="vendor/irstea/phpmd-config/strict.xml" />
<!-- ... -->
</ruleset>
```
composer.json 0 → 100644
{
"name": "irstea/phpmd-config",
"description": "Jeux de règles pour PHP Mess Detector.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Irstea - DSI - pôle IS",
"email": "dsi.poleis@irstea.fr"
}
],
"require": {
"phpmd/phpmd": "^2.6"
},
"config": {
"sort-packages": true
},
"archive": {
"exclude": [
".?*"
]
}
}
loose.xml 0 → 100644
<?xml version="1.0"?>
<ruleset name="Loose ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>The minimum rules for any project.</description>
<rule ref="rulesets/controversial.xml/Superglobals" />
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/>
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/>
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/GotoStatement" />
<rule ref="rulesets/design.xml/DevelopmentCodeFragment">
<properties>
<property name="unwanted-functions" value="var_dump,print_r,debug_zval_dump,debug_print_backtrace,dump" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>.*/cache/</exclude-pattern>
</ruleset>
strict.xml 0 → 100644
<?xml version="1.0"?>
<ruleset name="Strict ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>The recommended rules for any project.</description>
<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/design.xml">
<exclude name="DevelopmentCodeFragment" />
</rule>
<rule ref="rulesets/design.xml/DevelopmentCodeFragment">
<properties>
<property name="unwanted-functions" value="var_dump,print_r,debug_zval_dump,debug_print_backtrace,dump" />
</properties>
</rule>
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="em,id,qb,x,y" />
</properties>
</rule>
<rule ref="rulesets/unusedcode.xml" />
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>.*/cache/</exclude-pattern>
</ruleset>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment