karlosagudo/fixtro
Composer 安装命令:
composer require karlosagudo/fixtro
包简介
A QA static analysis code
README 文档
README
A tool/framework to fix and check static code analysis in our enviroments.
90% Users just need to run the install command, install the precommit and thats it, you will have a fixer of the code, and a way to analyze your code so detects possible(or future) errors. In order to do so execute:
composer require karlosagudo/fixtro --dev
vendor/bin/fixtro install
Usage:
{vendor-bin}/fixtro
In order to install:
{vendor-bin}/fixtro install
This will install fixtro dependencies and it as a precommit hook.
This is the command will be executed in each precommit:
{vendor-bin}/fixtro precommit
If want more info about the processes use verbose option -vvv
Fixtro uses local binaries in case it found it, (for example phpunit, phpmd, php-cs-fixer), but in case it doesnt find it, it uses the own from fistro. (Thats why the install run a composer inside the vendor folder)
With this special feature, there is no need to install anymore php-cs-fixer, phpunit etc in new projects, only need to install fixtro on it. Also , fixtro will try to look for local config files ie: .php_cs, phpunit.xml , inside the root folder of your project or the build one. So, if you want to configure the project just think, as is php_cs_fixer, or phpunit were installed on it.
Requisites
- Php 7.0+
- Composer
Important Read the section about Uncomfortable errors, and generate your own config files (.php_cs, phpunit.xml, psalm.xml, phpmd.xml) (TODO: this files will be generated in the install) You can put this files, in the root of your project, or in the build folder.
Commands
Are in the folder src/CodeQualityTool/Commands. There is a general Abstract called GeneralCommand, that normal commands will heritage.
Examples:
- FixEntireCommand - Will run all the checkers across the whole project
- FIxPreCommit- Its intended to be a git-hook precommit, so will analyze only precommited files. (Will ignore the config for src folder and execute in commited files)
All Commands have an array where you can put the analyzers, and filter by files (folder FilterFiles), and add extra parameters. This analyzers are in the Checker folder.
Checkers
Checkers are the fixers or checkers that run in each commit and are already configured to be used in fixtro List of Checkers
Uncomfortable errors
Some of the checkers will show possible errors, that are almost impossible to solve, or there is no need to lost time on it, but you still want to run the other checkers.
This usually happens on phpmd and psalm. You can configure your own configuration files for this projects, or avoid errors with annotations on the code:
You can also avoid errors, using a listener in your project. Check next section
Control Fixtro in your own project
Config File Reference
#####TODO:
- allow to generate your own runner in the config
- Tests, create a fake fixer test command, to add coverage
- Checker of phpunit and phpspec if the project has defined a spec folder / phphunit
karlosagudo/fixtro 适用场景与选型建议
karlosagudo/fixtro 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.11k 次下载、GitHub Stars 达 23, 最近一次更新时间为 2017 年 06 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 karlosagudo/fixtro 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 karlosagudo/fixtro 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-04
