简体   繁体   English

如何以php代码嗅探器开始

[英]how to start with php code sniffer

I have all written code and i want to this code standarise by php code sniffer. 我已经编写了所有代码,并且我想通过php代码嗅探器将此代码标准化。 I would like to know what is the best way to start with it. 我想知道什么是最好的开始方式。 I had installed it but when i run the command 我已经安装了它,但是当我运行命令时

 phpcs /path/to/code/myfile.php 

In the command line I got the last one hundered line error from 310 to 410. But if I want to see the starting errors of any line error how can I see that. 在命令行中,我得到了从310到410的最后一个受干扰的行错误。但是,如果我想查看任何行错误的起始错误,该怎么看。 Mostly errors are : 错误主要是:

 322 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
 322 | ERROR   | Line indented incorrectly; expected at least 8 spaces, found 2

How can I solve these things easily and in future it don't repeat, what it saying that I should not use tab, and use space, by using space it will take time. 我该如何轻松地解决这些问题,以后再也不会重复,它说的是我不应该使用制表符,也不使用空间,因为使用空间将需要时间。

And how can I start with basic standard, because don't want to utilize more time in this right now. 我该如何从基本标准入手,因为现在不想在此方面花费更多的时间。

You can change the output to summary only with command line option... 您只能使用命令行选项将输出更改为摘要...

--config-set report_format summary

All options . 所有选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM