Please refer to the Scopes feature. You can define a custom scope for just your code, without the library folder, then run inspections on this scope only.
In the Inspections settings it's also possible to add the scopes and enable/disable each inspection per scope.