PyCharm is not doing code inspection on non-project files
<p>I'm working on a Python project in PyCharm and I wanted to edit a python script outside the project. 
PyCharm doesn't inspect the code and doesn't give any PEP8 violations.
Hoped that there would be a setting for that but couldn't find anything so far.</p>

<p>Does anyone know how to enable code inspection on non-project files in PyCharm?</p>

<p><a href="https://i.stack.imgur.com/ETzKa.png" rel="nofollow"><img src="https://i.stack.imgur.com/ETzKa.png" alt="enter image description here"></a></p>

<p>I am able to reproduce the problem (with 5.0.5 Pro Linux version).</p>

<p>The inspection is actually active and the PEP8 checks are all enabled, I even got a <code>blank line at end of file</code> flag raised, but not an <code>unresolved reference</code> one:</p>

<p><a href="https://i.stack.imgur.com/Zo05U.png" rel="nofollow"><img src="https://i.stack.imgur.com/Zo05U.png" alt="enter image description here"></a></p>

<p>Looks like Arnaud P may be right, as the exact same file content in a project file raises the unresolved reference flags:</p>

<blockquote>
  <p>I suppose Pycharm considers it doesn't know enough to complain about
  unresolved variables, since this file might be part of another
  project. â Arnaud P 22 mins ago</p>
</blockquote>

<p>Confirmed by JetBrains:</p>

<blockquote>
  <p>This is the answer I've got from them: "This is expected behavior,
  this inspection is suspended if file is outside of current project.
  PyCharm doesn't know configuration, source roots, etc of other
  projects/other files." So I mark your suggestion as the accepted
  answer. â Sinan Ãetinkaya 5 mins ago</p>
</blockquote>

<p>As a workaround you could have a (re-usable) project with one (or more) files in which you paste non-project file contents just for the purpose of running inspections. </p>

<p>Or just create a project for that file.</p>

python pycharm inspection