IntelliJ:禁用单个模块的警告/错误 [英] IntelliJ: Disable warnings/errors for a single module

查看:101
本文介绍了IntelliJ:禁用单个模块的警告/错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近迁移到IntelliJ,需要解决一个特定的问题:我有一个包含许多模块的项目;这些模块之一仅用于测试,并且包含许多错误:

I've recently migrated to IntelliJ and need to solve a particular problem: I have a project that has numerous modules; one of these modules is purely for testing and contains a number of errors:

.

在此屏幕快照中,我想禁止显示有关NNGINETest的所有警告/错误/检查信息.有没有一种方法可以配置项目来做到这一点?我找到了这个答案:如何禁用一些检查IntelliJ IDEA中的模块?,但我不确定它是否适用于同一件事.最重要的是,答案对我来说还不太清楚,由于我对IntelliJ不熟悉,所以我无法理解所有步骤.

I'd like to suppress all warnings/errors/inspections on NNGINETest in this screenshot. Is there a way to configure the project to do that? I found this answer: How do I disable some inspections for modules in IntelliJ IDEA? but I'm not quite sure it's for the same thing. On top of that, the answer was a bit unclear to me and I wasn't able to understand all of the steps because of how new and unfamiliar with IntelliJ that I am.

如果有人可以向我彻底解释如何解决此问题,我将不胜感激.

If someone could please thoroughly explain to me how to solve this problem, I would be grateful.

推荐答案

我尝试扩展Eric的答案,但由于任意原因而被拒绝,因此我正在编写自己的文章,以尝试为遇到此问题的其他人澄清更多内容因为我讨厌官僚主义,所以这个问题.将其添加为答案将使我能够提供一些视觉辅助工具:

I tried to expand Eric's answer but it was rejected for arbitrary reasons, so I'm writing my own to try and clarify some more for anyone else that runs into this problem since I hate bureaucracy. Adding it as an answer will allow me to provide some visual aids:

NNGINETest具有在构建中报告的错误. Eric的答案是正确的,因为我们可以将其排除在外,但是问题是,当我右键单击项目并将其标记为以这种方式发布时,控制台在构建时仍然充满错误报告.我通过File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes

NNGINETest has errors that are reported in building. Eric's answer is correct in that we can exclude it, but the problem is that the console is still spammed with error reports upon building when I right clicked the project and marked it for exluding that way. I fixed it by excluding it via the menu in File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes

您可能还需要确保选中"Recusively"复选框以查找要排除的模块.

You'll want to probably also make sure that the "Recusively" checkboxes are checked for modules you want to exclude.

我真的不知道这与使用右键单击菜单选项有什么区别(我也无法在IntelliJ手册中找到任何有关它的信息,但也许有人可以在评论中提供链接),但是这成功地阻止了NNGINETest在构建过程中乱扔控制台:

I don't really know what the difference is here between this and using the right click menu option (I couldn't find anything in the IntelliJ manual about it either but maybe someone can provide a link in the comments), but this successfully prevented NNGINETest from littering the console during building:

此外,使用排除"菜单而不是模块的目录标记可以使该模块仍然出现在项目"模块列表中,而不是消失.被排除的文件夹将出现一个"x".我认为这非常有用:

Additionally, using the Excludes menu rather than the directory marking for the module allows it to still appear in the Project module list rather than disappearing. An "x" will appear by excluded folders. This is pretty useful in my opinion:

希望这会有所帮助!

这篇关于IntelliJ:禁用单个模块的警告/错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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