Configuring Inspection for Different Scopes
By default, all enabled code inspections analyze all files in your project. Depending on your needs, you can run the same inspection in more than one scope of files with different settings.
If one file is included in two or more scopes, and you enable an inspection in these scopes, PyCharm will process them according to their order in the list of scopes — the uppermost scope will have the highest priority, and therefore, it will be analyzed first.
In the Settings/Preferences dialog (Ctrl+Alt+S), select .
Select any inspection from the list.
From the In All Scopes list, select Edit Scopes Order.
Select the necessary scope, and use the and buttons to move it up and down the list.
If needed, create a new scope. To do so, click (Edit Scopes), specify scope settings, and select the files and folders that you want to include in it.