FAQ Database Discussion Community


Is it possible to ignore one single specific line with pylint?

python,pylint
I have the following line in my header: import config.logging_settings This actually changes my python logging settings, but pylint thinks it is an unused import. I do not want to remove unused-import warnings in general so is it possible to just ignore this one specific line? I wouldn't mind having...

How can I use pyreverse in Eclipse?

python,eclipse,pydev,pylint
I've installed Eclipse (latest stable) and integrated PyDev and PyLint succesfully. Now being a python noob I wonder if I could somehow get an UML sheme from within Eclipse to do some reverse engineering of existing python code. Thanks for your time guys!...

Pylint complains about the member of an instance that is set in another file

python,django,pylint
For my tests I created a method in the init.py file that I include in a lot of tests. Besides the fact that it seems to work pylint shows that the instance of the test class has no member floor. init.py def create_floor(self): self.floor = Floor.objects.create(level=0) ... test_something.py def setUp(self):...

pylint does not catch obvious error

python,pylint
This is my code: class Horse: def talk(self): print 'Hihaaa!' class Farm: def __init__(self, animal): self.animal = animal def animaltalk(self): self.animal.sing() def main(): horse = Horse() farm = Farm(horse) farm.animaltalk() main() This is my pylint: $ pylint --version No config file found, using default configuration pylint 1.4.3, astroid 1.3.6, common...

Django Lint throwing error

django,python-3.x,pylint
I installed Python Lint for static analysis of Python code pylint --version: No config file found, using default configuration pylint 1.4.1, astroid 1.3.4, common 0.63.2 Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] I am currently working on a django project, for which I installed python-django-lint package. But when...

pylint 1.4 reports E1101(no-member) on all C extensions

python,pylint,python-extensions
We've been long-time fans of pylint. Its static analysis has become a critical part of all our python projects and has saved tons of time chasing obscure bugs. But after upgrading from 1.3 -> 1.4, almost all compiled c extensions result in E1101(no-member) errors. Projects that previously run perfectly clean...

Pylint on StringIO or buffered text

python,io,pylint
I need to analyze some code generated "magically" in a function. The example I'm using is very simple. Here is what I intend to do: from pylint import epylint from StringIO import StringIO source = StringIO() source.write('def test():\n') source.write(' b = 5\n') source.write(' return\n') source.seek(0) epylint.py_run(source) The result I get:...

How to jump/display the column of an error

python,vim,syntax,pylint,syntastic
To check the syntax of my python scripts I am using the syntastic vim plugin with pylint as checker. Is there a way to not only display or highlight the line where an error occurs but the column/exact position of this error too? I used a vim syntax checker plugin...

How to prompt programmers to use try except clause in python?

python,exception-handling,static-analysis,pylint,try-except
Let's say I have a methodA that raises an exception: def methodA(x, y): if y != 0: z = x / y return z else: raise ZeroDivisionError("zero can not be a denominator") And in methodB I called methodA without handling the exception: def methodB(x, y): print methodA(x, y) Here I...

Is there a way to summarise or list all current PyLint errors, with sublime (or otherwise)?

python,sublimetext,pylint
Is there an option to list all current PyLint errors I have in my project, with sublime, using the Pylinter plugin or otherwise? Here is an example, of similar functionality, in eclipse: ...

Pylint Error when using metaclass

python,python-3.x,vim,pylint,syntastic
i try to fix all pylint errors and pylint warnings in a project. but i keep getting an error when i set a metaclass (https://www.python.org/dev/peps/pep-3115/). here is my example code: #!/usr/bin/env python3 class MyMeta(type): pass class MyObject(object, metaclass=MyMeta): # pylint error here pass the error just says "invalid syntax". i...

Proper style of coding __init__.py in Python modules

python,coding-style,pylint,spyder
I'm not that fluent in Python so I'm not sure if what I'm doing is common practice or the proper way to do it. I'm creating a module archive contaning files with one class each, e.g. SmsArchiveReader.py with class SmsArchiveReader inside. To make the imports less tedious, I decided to...

Show only errors with pylint and syntastic in vim

python,vim,pylint,syntastic
How to use synstastic in vim to display only pylint error messages? I basically want the output of pylint -E to be used as source for syntastic. I tried to configure syntastic in my .vimrc with: let g:syntastic_python_checkers = ['python', 'pylint -E'] which did not work. Also, I tried to...