as many others I have the problem that Intellij throws some warnings, that are not relevant to me. I can of course go through everyone of them and let Intellij insert the suppresswarning-tag. But I am wondering whether there is a more elegant way to do this.
When working with Pylint (Python Code Inspection) there was a pylint.rc file, where warnings could be suppressed. This does not only have the advantage that I have all the warnings I suppressed in one location, but also that I can simply copy this file to other projects and reuse it.
Is there a similar way for Intellij?
Yes, you can change setting of Code Inspection
When you open Analyze/Inspect code...
you can see and change your inspection profiles
and disable warnings what your want. Also you can do import and export your inspection profile
.
Inspection profiles
When you inspect your code, you can tell IntelliJ IDEA which types of problems you would like to search for and get reports about. Such configurations can be preserved as inspection profiles.
An inspection profile defines the types of problems to be sought for, i.e. which code inspections are enabled/disabled and the severity of these inspections. Profiles are configurable in the Inspections settings page.
To set the current inspection profile (the one that is used for the on-the-fly code analysis in the editor), simply select it in the Inspections settings page and apply changes. When you perform code analysis or execute a single inspection, you can specify which profile to use for each run.