On Sunday 06 December 2009, 13:11:21 detlev wrote: > Hi, > > what I forgot to mention is, that a single module of a project may be > checked via the project sources viewer context menu. Shall an entry be > added to each editor context menu as well?
It would fit nicely to the "Check" sub menu. > Regards, > Detlev > > On Samstag, 5. Dezember 2009, Dan Bullok wrote: > > On Saturday 05 December 2009 11:46:47 you wrote: > > > On Dienstag, 1. Dezember 2009, Dan Bullok wrote: > > > > On advice from Mikhail Terekhov, I put an empty __init__.py file in > > > > the same directory as my project. PyLint works properly now. I > > > > don't really understand this requirement, as I run PyLint on single > > > > files from the command line all the time. And if it is a > > > > requirement, then it should definitely be stated clearly in the > > > > PyLint dialog that it only works on packages, and suggest that the > > > > user put an empty __init__.py file in the project directory if they > > > > are not already working on a package. -Dan > > > > > > The PyLint plugin is used to check the project (that's why it is > > > accessible via the project menu). pylint -h gives you the following > > > output. > > > > > > Usage: pylint [options] module_or_package > > > > > > That clearly indicates, that pylint only works on modules and > > > packages. Consequently the project's main directory must be a > > > package. Should eric4 generate an empty __init__.py file, if it > > > doesn't discover one in the project dir? > > > > Hi Detlev. > > > > I agree that it's absolutely logical that PyLint works this way. Since > > it's invoked from the project menu, it makes sense that it acts on the > > entire project. However, I think that this can be confusing from the > > user's perspective, especially for someone who is used to using PyLint > > from the command line (In my own use, I almost always run it on one > > file at a time). My thought was that if I click on Check->PyLint, the > > file that I'm currently editing should be checked. Now, in retrospect, > > since all of the functions on the project menu act on the entire > > project, my assumption is obviously not a good one. However, I think > > it may be a common misunderstanding. > > > > In any case, if the user runs pylint, and there is no __init__.py file, > > they get an empty result dialog, which is very frustrating. An error > > message would be extremely helpful to figure out WHY it isn't working. > > Something like "PyLint can only be run on a package. If you wish to > > run PyLint, your project's main directory must contain an __init__.py > > file. An empty file will suffice." Do it the other way around. If called from the menu, check, if __init__.py exists, and if not, present a simple dialog, stating that pylint for the whole project needs an empty __init__.py module, and ask the user, if eric should fix this problem by creating the file and adding it to the project. A hint on how to check single modules would be nice in that dialog, too. > > Also, I think it would be useful to be able to check ONLY the file > > being edited. If you agree, I'd be happy to create patches to do both > > of these things. Cheers, Pete _______________________________________________ Eric mailing list Eric@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/eric