如何从PHPStorm的代码检查中排除文件/文件夹? [英] How to exclude files/folders from code inspection in PHPStorm?

查看:667
本文介绍了如何从PHPStorm的代码检查中排除文件/文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHPStorm中有一个项目,该项目包含归类在library文件夹下的一些库(Zend,Doctrine等).

I have a project in PHPStorm, which contains a few libraries (Zend, Doctrine, ...) grouped under a library folder.

在运行代码检查时,我要做要分析这些文件夹中的PHP代码(例如,PHPStorm将知道如何声明Zend_Form.)

When running the code inspection, I do want the PHP code in these folders to be analysed (so that PHPStorm will know how Zend_Form is declared, for example).

但是,我希望报告在这些文件夹中发现的问题,因为这些问题不在我的控制范围内.

However, I do not want the issues found in these folders to be reported, as they are out of my control.

到目前为止,我发现的唯一解决方法是将目录标记为测试源",然后在代码检查窗口中取消选中包括测试源"框.不用说这不是最好的解决方案!

The only workaround I've found so far is to mark the directories as "Test source", and uncheck the "Include test sources" box in the code inspection window. Needless to say that this is not the best solution!

推荐答案

请参考合并范围功能.您可以只为代码定义自定义范围,而无需库文件夹,然后仅在此范围上运行检查.

Please refer to the Scopes feature. You can define a custom scope for just your code, without the library folder, then run inspections on this scope only.

检查设置中,还可以添加范围并启用/禁用每个范围的每个检查

In the Inspections settings it's also possible to add the scopes and enable/disable each inspection per scope.

这篇关于如何从PHPStorm的代码检查中排除文件/文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆