Search code examples
intellij-ideapycharmjetbrains-ideappcodecode-inspection

JetBrains - Exclude third party code from inspections?


In JetBrains IDEs (e.g. PyCharm, AppCode, IntelliJ, etc) how can I exclude third party code from inspections? I know I could completely exclude the code from the project by marking the containing directories as excluded directories. However, I would still like my code to acknowledge the third party packages. That being, I would like my code to mark the third party functions as existing in my project, autocomplete should work, etc. I just don't want to see warnings and code style comments from the IDE when regarding this code or running the code inspection on the project. Thanks!


Solution

  • It sounds like you are not adding the third-party code correctly. It sounds like you are placing them in as part of your project rather than adding them as library definitions in the Project Structure (File > Project Structure). If they are in your code structure, inspections are performed on them since they simply appear as part of your project. If they are added as libraries, inspections are not run on them (nor are code refactorings), but they are still available for code completion, etc. See http://www.jetbrains.com/idea/webhelp/library.html for more information.