mnapoli/pretty
Composer 安装命令:
composer create-project mnapoli/pretty
包简介
Run all code formatting tools with one command: pretty
README 文档
README
A single CLI command with sane defaults to simplify CodeSniffer and PHP-CS-Fixer.
PHP CodeSniffer and PHP-CS-Fixer are powerful but using them is not simple. It is not always obvious which tool a project uses and whether there is a configuration file to use or whether you need to provide options to the CLI command.
Now it's easy, simply run:
pretty
Pretty will detect the configuration file that exist in the current directory and will run the correct tool. If no configuration file exist, Pretty will run PHP CodeSniffer with PSR-2 by default.
If errors are found, simply run:
pretty fix
Again, Pretty will run the appropriate tool (php-cs-fixer or phpcbf) to fix as many errors as possible in your code.
Installation
If you have already set up a global install of Composer just run:
composer global require mnapoli/pretty
Pretty comes with no dependencies so it should not bring any conflict in Composer.
You can also install it as a local dependency of your project with composer require --dev mnapoli/pretty. In that case you can start the tool with vendor/bin/pretty.
You will be able to update to new versions by running:
composer global update mnapoli/pretty
Usage
Running an analysis is as simple as running:
pretty
This command will not change any code. To fix errors reported by this command, simply run:
pretty fix
In case you are running the analyses in CI you might want to run:
pretty ci
This will disable the caching option of PHP-CS-Fixer or CodeSniffer (because the cache will not be kept in CI).
Hosted continuous integration
If you are using pretty in your daily development workflow you may be interested in PrettyCI.com, the SaaS version of pretty.
mnapoli/pretty 适用场景与选型建议
mnapoli/pretty 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.14k 次下载、GitHub Stars 达 108, 最近一次更新时间为 2017 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「code」 「style」 「formatting」 「pretty」 「standard」 「PSR-2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mnapoli/pretty 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mnapoli/pretty 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mnapoli/pretty 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
A library that can render international postal addresses in different formats.
A Symfony bundle for using the CssToInlineStyles translator by tijsverkoyen
A data transforming/formatting package for php.
Fixing php code style
The coding standard applying to all Youdot PHP projects, based on Doctrine set of PHPCS rules, with additional checks.
统计信息
- 总下载量: 5.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 108
- 点击次数: 8
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-14