Exclude directory from intellij inspection, but not exclude from autocomplete
Asked Answered
D

3

19

As far as I know, the only way to exclude a directory is to mark it as excluded in project structure. However, this would make IntelliJ totally ignore the directory. Thus it will not appear in autocomplete options.

I do not want this. I want exclusion from inspections but inclusion in everything else. Is this possible?

I'm using Intellij 12.0.2. And, it's actually the bootstrap css and js failing the inspection.

Downdraft answered 21/1, 2013 at 11:27 Comment(1)
You can set the default "Inspection Scope" to be a "Custom Scope"Orville
C
15

As suggested by Peter Lawrey, the proper solution would be to use the custom inspection scope that excludes the directories where you don't want the inspections to be run.

Council answered 22/1, 2013 at 8:57 Comment(2)
I have modified the scope, but it is not applied. Why? I have even recreated the cache & restarted the application.Wolgast
@Wolgast after scope created: inspections -> select some inspections, select scope and change themIllness
A
14

With IntelliJ 15, you can mark the directory as Generated Sources Root. This skips the inspections but auto-complete will still work.

  1. Right click on the desired directory
  2. Select Mark Directory As/Generated Sources Root

NB: It seems, that you cannot select this type in the Project Structure dialogue, only via the right click.

Abnaki answered 15/2, 2016 at 13:25 Comment(0)
H
8

There is man in a hat in status bar. Click on it and select inspection level.

enter image description here

Also, if you have many files you want to supress inspection, then go to .idea and edit workspace.xml, find <component name="HighlightingSettingsPerFile"> and add line like this:

<setting file="file://$PROJECT_DIR$/src/main/config/config.xml" root0="SKIP_HIGHLIGHTING" />

I find it simplier than editing inspection levels.

Harveyharvie answered 21/1, 2013 at 11:29 Comment(3)
that doesn't answer the questionDowndraft
As soon as I start IDEA, I'll provide a screenshot. Also, I'll mention how to do it by modifying XML file.Harveyharvie
don't worry I need to define my own custom scope as commentedDowndraft

© 2022 - 2024 — McMap. All rights reserved.