pylint

invoking pylint programmatically

I'd like to invoke the pylint checker, limited to the Error signalling part, as part of my unit testing. so I checked the pylint executable script, got to the pylint.lint.Run helper class and there I got lost in a quite long __init__ function, ending with a call to sys.exit(). anybody ever tried and managed to do so? the dream-plan wo...

pylint failing for a number of django imports

I am using pylint, pylint -e app/views.py Gives me errors like E: 3: No name 'shortcuts' in module 'django' E: 7: No name 'db' in module 'django' But passes for other django imports. Since it passes for other Django import Django is on my pythonpath. ...

pylint giving a number of errors with maximum recursion depth reached.

Pylint gives me an error like this very frequently. shabda@jazzy ~/uswaretech_uswaretechsite> pylint -e utpages/forms.py No config file found, using default configuration Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.RuntimeError'> ignored The logalib mailing list discuss...

pylint seems to not handle "from . import foo" style imports

If I do: from . import foo In a script and run pylint over it, I get: F: 1: Unable to import %r Is there a way a work around for getting pylint to understand this syntax? ...

Why does Pylint give error E0702, raising NoneType, on this raise statement?

Say I have the following code. def foo(): foobar = None if foobar is not None: raise foobar When I run this code through pylint, I get the following error: E0702:4:foo: Raising NoneType while only classes, instances or string are allowed Is this a bug in pylint? Is my pylint too old? pylint 0.18.0, astng 0.19.1, c...

Colorize PyLint Output?

Anyone have any tricks/techniques for colorizing PyLint output? ...

How would I start integrating pyflakes with Hudson

We use Hudson for continuous integration with the Violations Plugin which parses our output from pylint. However, pylint is a bit too strict, and hard to configure. What we'd rather use is pyflakes which would give us the right level of "You're doing it wrong." ...

pylint ignore by directory

Following is from pylint docs: --ignore=<file> Add <file or directory> to the black list. It should be a base name, not a path. You may set this option multiple times. [current: %default] Yet I'm not having luck getting the directory part work. I have directory called migrations, which has django-south migration files. As I enter...

I'm having trouble setting up pylint with pydev.

I have installed pylint via easy_install. I can run lint.py <filename> with success. But pydev refuses to use it. I checked "use pylint" I configured correct path I updated my python interpreter in eclipse to have pylit in pythonpath I use Eclipse Galileo I have build automatically checked I tried cleaning whole project and no errors ...

Pylint only Global evaluation

In pylint I use this command --reports=n to disable the reports, but now I don't see the Global evaluation more. Is possible enable only the Global evaluation? ...

How to handle the pylint message: Warning: Method could be a function

Being new to Python, I decided to get some feedback on a class I'd written ASAP so I ran it against pylint. Is the message it gave "Warning: Method could be a function" telling me that it would be better to move this method out of the class because it doesn't use any instance variables? In c# I would make this a static method. What's the...

Disable all `pylint` 'Convention' messages

Hello, Background I find pylint useful, but I also find it is horrifically undocumented, has painfully verbose output, and lacks an intuitive interface. I'd like to use pylint, but it keeps pumping out an absurd number of pointless 'convention' messages, e.g. C: 2: Line too long (137/80) etc. Question If I could disable these, pylin...

Imports failing for pylint

I'm testing my project using pylint and currently getting fatal error when importing the internal apps into the project using. According to pylint, the import should be something like from <appname>.models import ... as opposed to what I currently have: from <projectname>.<appname>.models import My problem is that when I use the recomm...

Pylint equivalent for Py3k

Pylint doesn't yet support Py3k, so am looking for an alternative. [note] An immature branch off some VCS would be sufficient enough for me to try out. ...

Reason for low Pylint ratings of Python standard library code

Hey everyone! A friend told me about Pylint and just out of curiosity, I ran it against some of the standard library modules. To my surprise, the ratings were low. Here are a few runs: os.py Your code has been rated at 3.55/10 random.py Your code has been rated at 4.74/10 I ran it on some more modules and the found the rating to be...

Quieting pylint false-positives when using django.

Hi all, I'd like to sanely quiet a few pylint errors when using Django. The two that are causing the greatest irritation are when deriving from django.db.models.Model and accessing objects, and django.test.TestCase. In the first, pylint complains about any code that uses the attribute 'objects', saying it isn't a member. In the second...

Can an API tell Pylint not to complain in the client code?

I have some code in a reusable class that modifies some types. Here's a simplified version. class Foo: def __init__(self): self.count = 0 def increment(self): self.count += 1 # Add another method outside of the class definition. # Pylint doesn't care about this, and rates this file 10/10. Foo.__dict__["current...

Why doesn't Pylint like built-in functions?

Hi, I have a line like this: filter(lambda x: x == 1, [1, 1, 2]) Pylint is showing a warning: W: 3: Used builtin function 'filter' Why is that? is a list comprehension the recommended method? Of course I can rewrite this like this: [x for x in [1, 1, 2] if x == 1] And I get no warnings, but I was wondering if there's a PEP fo...

change background color highlight for errors detected by pylint with ropevim and ropemode installed

It changes the background to red, I can't read the text to correct the error! How can I configure a different highlight? Does it have a setting? ...

Should wildcard import be avoided?

I'm using PyQt and am running into this issue. If my import statements are: from PyQt4.QtCore import * from PyQt4.QtGui import * then pylint gives hundreds of "Unused import" warnings. I'm hesitant to just turn them off, because there might be other unused imports that are actually useful to see. Another option would be to do this:...