dprevite/lint

Lint会对你的代码进行语法错误扫描。

这个包的官方仓库似乎已经不存在,因此该包已被冻结。

1.0.0 2014-03-20 03:52 UTC

This package is not auto-updated.

Last update: 2024-05-07 04:09:15 UTC


README

image

Latest Stable Version Total Downloads Latest Unstable Version License

这是一个用于扫描PHP代码语法错误的命令行工具。您可以从命令行或构建脚本中运行它。

用法

usage: lint [-qb] [path]

options:
  -q, --quiet:     disable verbose output
  -b, --blame:     display git blame along with error messages
  --exclude:       comma separated list of folder patterns to exclude
  -h, --help:      display this help screen

示例

找出谁导致了语法错误:(需要git)

$ lint -b ../filename.php
Linting files against PHP 7.0.6

E
1 files checked, 1 errors.
PHP Parse error:  syntax error, unexpected ';' in filename.php on line 5
     Caused by Dan Previte <[email protected]>

检查文件,但忽略某些模式以加快测试速度

$ lint --exclude=*views*
Linting files against PHP 7.0.6

............................................................
............................................................
................................................E...........
180 files checked, 1 errors.
PHP Parse error:  syntax error, unexpected ';' in filename.php on line 26
     Caused by Dan Previte <[email protected]>

安装

Composer

composer require dprevite/lint

单行安装器

wget https://raw.githubusercontent.com/dprevite/lint/master/scripts/lint && sudo mv lint /usr/local/bin/lint && sudo chmod 0755 /usr/local/bin/lint