galek/coding-standard

v2.1.5 2021-02-12 11:06 UTC

README

我从nette/coding-standard进行了分支

使用Nette Coding Standard检查并修复您的代码

Downloads this Month Build Status Latest Stable Version License

这是一个在EasyCodingStandard下结合的snifffixers集合,用于对您的PHP代码进行编码标准的检查和修复。

覆盖哪些规则?

此包覆盖了官方规则的一部分,而不是全部。

当您打开/examples目录时,您将看到的所有文件都将通过此编码标准进行检查。与您所知的Nette代码相比,代码可能看起来不合法,但这仅仅是因为此工具尚未检查它。

您可以在coding-standard-php56.yml文件中找到所有通用规则

安装和使用

本地设置

安装到名为coding-standard的全局文件夹中

composer create-project galek/coding-standard

检查编码标准

coding-standard/ecs check src tests --config coding-standard/coding-standard-php56.yml

并修复它

coding-standard/ecs check src tests --config coding-standard/coding-standard-php56.yml --fix

Travis设置

# .travis.yml
install:
    - composer create-project galek/coding-standard temp/coding-standard

script:
    - temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php56.yml