1

Closed

pylint - only python files should be examined

description

I noticed that pylint reports errors in readme.txt or foo.sh
Closed Aug 12 at 7:22 PM by Zooba
Add Existing Item no longer adds items with the wrong build action, and the rest of the problem is by design.

comments

pminaev wrote Jun 18 at 12:30 AM

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 9: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 10:03 AM

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