1
Vote

pylint - only python files should be examined

description

I noticed that pylint reports errors in readme.txt or foo.sh

comments

pminaev wrote Jun 17 at 11:30 PM

It runs on all items that are marked as <Compile> in the project file (this is the same as "Build Action" in the Properties window when the item is selected in Solution Explorer). Generally speaking, only code should be <Compile>, and everything else should be <Content> (or <None> if it's not used at all when the app is running). This is a generic VS thing, though it's a misnomer in Python case as it doesn't really compile (but it is consistent with JS projects). It's used elsewhere to distinguish code, e.g. during publish.

If you use File -> New, Add New Item or Add Existing Item commands to add things to your project, then Content should automatically be set for .txt and other types. It should also be set if you use the Project From Existing Code wizard. Can you clarify how you ended up with a .txt file that is set to Compile in the project?

paweljasinski wrote Jun 18 at 8:58 AM

I believe, I have used "Add Existing Item"
In the project file it is marked as compile, but when I check properties of a file, Build Action is set to "Content".
I guess project file has no distinction between "Compile" and "Content".
If I change the Build Action to "Resource", project file changes and element containing file is <Resource/>

paweljasinski wrote Jun 18 at 9:03 AM

And of course I can set the "Build Action" to "None".