在 IntelliJ IDEA 中,如何为新项目设置默认检查配置文件?

In IntelliJ IDEA, how to set default inspection profile for new projects?

我有一个自定义的 IDE 范围的 IntelliJ 检查配置文件 IDEA。我经常创建新项目,我希望默认使用此配置文件。

我尝试转到 File > Other Settings > Default Settings... 并更改 Editor > Inspections > Profile 以指向我的新配置文件。但是当我创建一个新项目时,它仍然使用 Project Default 配置文件。

这个设置是不是坏了?我对默认 project/profile 设置的理解不正确吗?

创建新项目时,您 select 作为默认配置文件的检查将复制到项目默认配置文件中。有一个未解决的问题:

您的具体问题在问题 5 中有描述:

There doesn't seem to be a way to set a global profile as the default for new projects such that the project continues to use the global default. If on the default settings dialog I set my profile to "My Standard Inspections", when I create a new project, the settings I have in "{idea.home}/inspections/My Standard Inspections.xml" are copied to ".idea/inspections/Project_Default.xml". While I can understand this might be desired behavior for teams that want a standard inspection profile used for a project and for it to be shared via VCS, that is not the case for me (and my co-workers). I want a global profile that all my projects use such that as I tweak my inspection profile over time, all projects use the updated profile (as they are using a common global profile). This is the paradigm I've used since IDEA v3. But it's broken down recently because of the reworking of inspection profile management. While I could go in and change the inspection profile from "Project Default" to "My Standard Inspections" each and every time I create a new project, that is a real pain, and is error prone. I think there needs to be an option to select the behavior for the default profile setting to either "Use as a global profile" or "Copy to project default profile".

我们也为这个问题创建了一个单独的问题,请关注更新:

  • IDEA-170928默认检查配置文件未应用于新项目