amv-hub/amv-lint
Composer 安装命令:
composer require amv-hub/amv-lint
包简介
This is a tool for checking a consistency and coding convention of Laravel project. Please contact me if you have any problem when using it.
README 文档
README
Check coding convention, coding consistency for your laravel project.
Install
Run follow command in root directory of your laravel project:
composer require amv-hub/amv-lint --dev
After package installed, run following command to initialize the package config:
./vendor/amv-hub/amv-lint/init.sh
Usage
Checking:
After package installed, to lint your project included checking env variable, checking language translation files,
check coding consistency and coding convention of JavaScript, PHP, please run following command:
amv lint
Individual Feature Checking:
For checking individually for each feature, please provide a third parameter, included env, lang, php, js:
amv lint env
amv lint lang
amv lint php
amv lint js
Force to DEBUG MODE:
By default, the checking execution will stop when first error occurs. Sometimes, you need the checking execution doesn't
stop until the end. So, just provide -g flag for execution command. Notice: if you provide the individual feature for checking,
please place -g flag just before the name of checking feature.
amv lint -g
amv lint -g env
amv lint -g lang
amv lint -g php
amv lint -g js
Fixing common problem:
AMV Lint use PHP_CodeSniffer for checking coding convention of PHP files and use ESLint to checking for JavaScript files.
So you can use all of their feature to perform the check. Two of them also provide the tool for fixing some of common problem.
You can perform that fixing feature by following command:
amv lint --fix
Or fixing an individual feature by:
amv lint php --fix
Configurations
The general configurations file is .amv_lint.env, which was placed is your project root folder. It contains
various environment variable. These following features are the most important you should know.
DEBUG_MODE:
When you turn this variable to true, it will work same way when you turn -g flag in your checking command.
But this variable will be ignored when you provide -g flag. For example, if you set this DEBUG_MODE to false,
CHECKING_STANDARDS:
This is the list of PHP standards for checking execution. Standards are separated by a comma , and you can provide a following standards:
psr1, psr2, psr12, pear.
IS_STAGED_CHECKING:
If set it true, the checking execution will perform a check with the staged files (the files that you added it for commit). Otherwise, if you set this variable to false, these following folder will be checked:
- ENV variable checking: folders which represent in
ENV_USING_CHECKING_DIRSvariable. - For PHP files checking: folders which represent in
PHP_CONVENTION_CHECKING_DIRSvariable. - For JavaScript checking: folders which represent in
JS_CONVENTION_CHECKING_DIRSvariable.
These variable's value is string of one or many folders, separated by a comma ,
amv-hub/amv-lint 适用场景与选型建议
amv-hub/amv-lint 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 389 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 06 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 amv-hub/amv-lint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 amv-hub/amv-lint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 389
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2021-06-22