TASK: Add further linting
This commit is contained in:
parent
3e89316430
commit
b8d84c5bdc
4 changed files with 81 additions and 9 deletions
|
@ -2,10 +2,33 @@ before_script:
|
|||
- apk add --no-cache make wget git
|
||||
- make install-composer
|
||||
- make install
|
||||
- mkdir -p result
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
lint:coding-guideline:
|
||||
image: php:7.0-alpine
|
||||
stage: test
|
||||
script:
|
||||
- ./vendor/bin/phpcs -s
|
||||
- ./vendor/bin/phpcs -s > result/phpcs-summary.txt
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- result
|
||||
|
||||
lint:php-mass-detection:
|
||||
image: php:7.0-alpine
|
||||
stage: test
|
||||
script:
|
||||
- ./vendor/bin/phpmd src text phpmd.xml > result/phpmd.txt
|
||||
- ./vendor/bin/phpmd src html phpmd.xml > result/phpmd.html
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- result
|
||||
|
||||
test:5.6:
|
||||
image: php:5.6-alpine
|
||||
stage: test
|
||||
|
@ -18,4 +41,10 @@ test:7.0:
|
|||
script:
|
||||
- ./vendor/bin/phpunit
|
||||
|
||||
test:latest:
|
||||
image: php:7-alpine
|
||||
stage: test
|
||||
script:
|
||||
- ./vendor/bin/phpunit
|
||||
|
||||
# Further stages, and jobs e.g. linting, cgl, etc.
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
"name": "siepmann/typo3_update",
|
||||
"description": "Auto migrate PHP Source of extensions to be compatible.",
|
||||
"type": "project",
|
||||
"license": "GPL-2.0+",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Daniel Siepmann",
|
||||
"email": "coding@daniel-siepmann.de"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Typo3Update\\Tests\\": "tests/",
|
||||
|
@ -22,15 +29,10 @@
|
|||
"squizlabs/php_codesniffer": "2.8.*",
|
||||
"symfony/yaml": "3.2.*"
|
||||
},
|
||||
"license": "GPL-2.0+",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Daniel Siepmann",
|
||||
"email": "coding@daniel-siepmann.de"
|
||||
}
|
||||
],
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"symfony/finder": "^3.2"
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"symfony/finder": "3.2.*",
|
||||
"phpmd/phpmd": "2.6.*",
|
||||
"pdepend/pdepend": "2.5.*"
|
||||
}
|
||||
}
|
||||
|
|
22
phpcs.xml.dist
Normal file
22
phpcs.xml.dist
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="PHP_CodeSniffer">
|
||||
<description>The coding standard for this Project</description>
|
||||
<rule ref="PSR2"/>
|
||||
<file>./src</file>
|
||||
<file>./tests</file>
|
||||
<exclude-pattern>*/Fixtures/*</exclude-pattern>
|
||||
|
||||
<!-- Excludes for PHPCS Code Style -->
|
||||
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
|
||||
<exclude-pattern>*Sniff.php$</exclude-pattern>
|
||||
<exclude-pattern>*/Tokenizers/*</exclude-pattern>
|
||||
</rule>
|
||||
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
|
||||
<exclude-pattern>*Sniff.php$</exclude-pattern>
|
||||
<exclude-pattern>*/Tokenizers/*</exclude-pattern>
|
||||
</rule>
|
||||
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
|
||||
<exclude-pattern>*Sniff.php$</exclude-pattern>
|
||||
<exclude-pattern>*/Tokenizers/*</exclude-pattern>
|
||||
</rule>
|
||||
</ruleset>
|
19
phpmd.xml
Normal file
19
phpmd.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="My first PHPMD rule set"
|
||||
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"
|
||||
xsi:noNamespaceSchemaLocation="
|
||||
http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>
|
||||
My custom rule set that checks my code...
|
||||
</description>
|
||||
|
||||
<rule ref="rulesets/cleancode.xml" />
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/controversial.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
<rule ref="rulesets/naming.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
</ruleset>
|
Loading…
Reference in a new issue