By default all enabled code inspections apply in all project files. If necessary, you can configure each code inspection (enable/disable, change its severity level and options) individually for different scopes. Such configurations, like any other inspection settings, are saved and applied as part of a specific profile.
There may be complicated cases when an inspection has different configurations associated with different scopes. When such inspection is executed in a file belonging to some or all of these scopes, then the settings of the highest priority scope-specific configuration are applied. The priorities is defined by the relative position of the inspection's scope-specific configuration in the inspection settings: the uppermost configuration has the highest priority. The configuration Everywhere else always has the lowest priority.
- In the inspection settings, select the desired profile. The inspections associated with the profile are displayed in the tree view.
- Select the desired inspection or inspection group and click Add Scope on the toolbar.
Choose Scope dialog box that opens, select a
scope to configure an inspection for.
The new scope-specific configuration In scope '<scope name>' as well as the configuration for the rest of the files Everywhere else will ba added to the inspection.
For more information on creating new and configuring existing scopes, see Configuring Scopes and File Colors.
- Select the scope-specific configuration and customize it as necessary: enable or disable it, change its severity and the other options, which can be different for various inspections.
- Customize the Everywhere else configuration to define the inspecion behavior out of the scope.
- If necessary, add more scope-specific configurations for the inspection.
- If there are several scope-specific configurations, define their relative priorities: select a configuration and click Move Scope Up / Move Scope Down
- Apply changes.