Codesniffer 使用 pear 标准忽略行缩进
使用带有 pear 标准的 codeniffer。 由于行缩进,我遇到了超过 20tsd 错误。 我使用制表位进行缩进。 我尝试禁用该检查,但失败了。
我从 pear 标准的ruleset.xml 中的通用标准中删除了最后一条规则。 然而,缩进仍然被认为是一个错误。
如何完全删除梨标准的缩进检查?
using codesniffer with pear standard.
I got over 20tsd errors cause of line indents.
I use tab-stops for indenting.
I try to disable that check but I failed.
I removed the last rule from the generic standards in the ruleset.xml for the pear standard.
Yet the indenting is still considered an error.
How do I remove the indention checks completely for the pear standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它应该可以工作,因此您绝对应该尝试了解为什么调整
ruleset.xml
文件在您的环境中不起作用,否则您将错过 CodeSniffer 的许多功能。提醒一下,这里有两个选项:
您在规则集中明确排除嗅探:
或者您将特定错误消息静音,从而导致针对潜在的其他错误消息实际执行规则:
It should work, so you should definitely try to understand why tweaking your
ruleset.xml
file doesn't work in your environment, otherwise you'll be missing many features from CodeSniffer.As a reminder, here are the two options:
Either you explicitly exclude the sniff in your ruleset :
Or you mute down a specific error message, resulting in the rule actually being executed for potential other error messages :
您可以通过搜索以下文件“ScopeIndentSniff.php”来实现此目的,该文件必须位于“standards”下名为“WhiteSpace”的文件夹中。
只需重命名即可。
请注意,应用程序可能有自己的标准文件夹。例如,Eclipse 有一个自己的文件夹,其中存放标准。
因此,如果您编辑共享文件夹,这可能不适用。
但您也可以将 Eclipse 设置为使用您的共享文件夹。
(首选项 -> PHP 工具 -> CodeSniffer -> CodeSniffer 标准)
You can achieve this by searching for the following file "ScopeIndentSniff.php" this must be in a folder called "WhiteSpace" under "standards".
Just rename it.
Be aware that applications may have their own folder with standards. Eclipse for example has an own folder where standards rest.
So if you edit your share folder this might not apply.
But you can setup Eclipse to use your share folder too.
(Preferences -> PHP Tools -> CodeSniffer -> CodeSniffer Standards)