当CodeSniffer分析返回一些错误时,我尝试将检查器配置为失败,但没有结果。
到目前为止,我尝试过的是:
V1:
build:
tests:
override:
command: './vendor/bin/phpcs ./src --report=checkstyle --report-file=cs-data'
analysis:
file: 'cs-data'
format: 'php-cs-checkstyle'V2:
build:
tests:
override:
- 'phpcs-run'我的工具和build_failure_conditions
tools:
php_code_sniffer:
config:
standard: "PSR2"
checks:
php:
code_rating: true
duplication: true
build_failure_conditions:
- 'issues.label("coding-style").new.exists'少了什么?
发布于 2017-09-01 23:50:54
TLDR;看起来您没有指定要扫描哪些文件夹以查找错误。
尝试使用以下方法:
build:
tests:
override:
- 'phpcs-run --standard=custom/standard/ruleset.xml --ignore=app/*/*/Test/ app/dir1/ app/dir2/ app/other/folder'有些事情需要我澄清:
我目前正在使用:
build_failure_conditions:
- 'issues.label("coding-style").new.exists'有关如何设置故障条件的更多信息:状态
https://stackoverflow.com/questions/45093243
复制相似问题