php - Makefile:12:目标“lint”的配方失败
问题描述
我正在 GitHub 存储库上发出拉取请求。在进行 PR 之前,我已经使用 PHPUnit 测试了我的代码,并且所有测试都通过了。所以,我在 GitHub 上做了 PR。但是在 travis-ci 检查了我的 PR 之后,我的 PR 没有通过并且错误说:
Makefile:12:目标“lint”的配方失败
我对所有这些错误一无所知。我想如果我的 PHPUnit 测试成功,那么我将通过 travis-ci 检查。但不幸的是没有。
这是我遇到的一些错误
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
[32mGenerating optimized autoload files[39m
travis_time:end:2e276f14:start=1563869333859320964,finish=1563869405903083472,duration=72043762508
[0Ktravis_fold:end:install
[0Ktravis_time:start:113ef200
[0K$ make lint
php /home/travis/build/cloudflare/cloudflare-php/vendor/bin/php-cs-fixer fix --config=/home/travis/build/cloudflare/cloudflare-php/.php_cs --dry-run
Loaded config [33mdefault[39m from "/home/travis/build/cloudflare/cloudflare-php/.php_cs".
1) cloudflare-php/src/Endpoints/Zones.php
2) cloudflare-php/tests/Endpoints/ZonesTest.php
Checked all files in 0.893 seconds, 14.000 MB memory used
Makefile:12: recipe for target 'lint' failed
make: *** [lint] Error 8
travis_time:end:113ef200:start=1563869405907430819,finish=1563869407016751613,duration=1109320794
[0K[31;1mThe command "make lint" exited with 2.[0m
travis_time:start:0ca9e138
[0K$ make test
php /home/travis/build/cloudflare/cloudflare-php/vendor/bin/phpunit --configuration /home/travis/build/cloudflare/cloudflare-php/phpunit.xml
PHPUnit 5.7.5 by Sebastian Bergmann and contributors.
............................................................... 63 / 120 ( 52%)
......................................................... 120 / 120 (100%)
Time: 8.69 seconds, Memory: 10.00MB
OK (120 tests, 720 assertions)
travis_time:end:0ca9e138:start=1563869407021249545,finish=1563869415802590423,duration=8781340878
[0K[32;1mThe command "make test" exited with 0.[0m
Done. Your build exited with 1.
解决方案
CI/CD 管道将为您的构建添加一个抽象层。在本地运行测试,它应该为您输出提示 =)
$ php ./vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
/Repos/cloudflare-php/tests/Endpoints/ZonesTest.php:9 The class ZonesTest has 11 public methods. Consider refactoring ZonesTest to keep number of public methods under 10.
推荐阅读
- c++ - 在 C++ 中调用虚函数时出现分段错误
- reactjs - 可以将 reactstrap 与 react-hook-form 和 react-input-mask 一起使用吗?
- ruby-on-rails - Rails 在与日期时间相同的数据类型“period_end”上对多个模型进行排序
- amazon-web-services - AWS Elastic BeanStalk 写入 |/usr/sbin/rotatelogs 时出错
- php - 使用 php-deployer 时如何设置释放限制?
- github - 在 Github 上添加 GPG 密钥后,贡献从个人资料中消失了
- promise - 如何在外部访问promoise变量值
- angular - 创建中间列数未知的 Mat-table
- python-3.x - 添加代理时 Selenium 所需的功能崩溃
- excel - 查找并替换列宏中每出现一次的单词