pylint

How do I disable “missing docstring” warnings at a file-level in Pylint?

我是研究僧i 提交于 2019-12-29 10:54:12
问题 Pylint throws errors that some of files are missing docstrings. I try and add docstrings to each class, method and function but it seems that Pylint also checks that files should a docstring at the beginning of it. Can i disable this somehow? I would like to be notified of a docstring is missing inside a class, function or method but it shouldn't be mandatory for a file to have a docstring. (Is there a term of the legal jargon often found at the beginning of a proprietary source file? Any

How do I disable “missing docstring” warnings at a file-level in Pylint?

柔情痞子 提交于 2019-12-29 10:53:13
问题 Pylint throws errors that some of files are missing docstrings. I try and add docstrings to each class, method and function but it seems that Pylint also checks that files should a docstring at the beginning of it. Can i disable this somehow? I would like to be notified of a docstring is missing inside a class, function or method but it shouldn't be mandatory for a file to have a docstring. (Is there a term of the legal jargon often found at the beginning of a proprietary source file? Any

Using Pylint with Django

不想你离开。 提交于 2019-12-29 02:21:29
问题 I would very much like to integrate pylint into the build process for my python projects, but I have run into one show-stopper: One of the error types that I find extremely useful--: E1101: *%s %r has no %r member* --constantly reports errors when using common django fields, for example: E1101:125:get_user_tags: Class 'Tag' has no 'objects' member which is caused by this code: def get_user_tags(username): """ Gets all the tags that username has used. Returns a query set. """ return Tag

Where are detailed the rules, concepts and usages behind each pylint's warnings?

北城余情 提交于 2019-12-25 18:19:51
问题 I am still discovering Pylint and I understand why many Pythonists deactivate some (or many) warnings to lower Pylint 's voice, but for the moment, as a Python newbie I want to use pylint to improve my Pythonic comprehension and my code quality , in order to help me to: learning more from a statement/instruction deepen some concepts evaluate the benefits / drawback of a refactoring etc. So is there a place where all the warning are discussed, justified, explained or they simply came from the

Why does vscode pylint miss obvious errors?

删除回忆录丶 提交于 2019-12-24 10:59:46
问题 I have a python file open in Visual Studio Code with an obvious error (using an undefined variable) but the pylint issues listed under 'Problems' show only a long list of minor convention issues. Running pylint manually on it (separately from vscode) spots the error fine. The error is not explicitly excluded by any vscode pylint-related configs as far as I can see. 回答1: Eventually I discovered this was due to the following default setting in vscode: "python.linting.maxNumberOfProblems": 100

How do I get pylint to recognize MySQLdb members?

南楼画角 提交于 2019-12-24 02:25:37
问题 import MySQLdb try: dbcon = MySQLdb.connect(host=host_name, user=user_name, passwd=password, db=db_name) except MySQLdb.Error: pass getting this pylint warning Module 'MySQLdb' has no 'Error' member (no-member) 回答1: The Best: Using extension-pkg-whitelist option: A comma-separated list of package or module names from where C extensions may be loaded. Extensions are loading into the active Python interpreter and may run arbitrary code --extension-pkg-whitelist=_mysql PyLint parses (by default)

pylint ignored-classes in source file

女生的网名这么多〃 提交于 2019-12-24 01:19:51
问题 In pylint, I can put in my source code: # pylint: disable=no-member But, I really want to disable this warning against certain classes, in particular my google protobuf classes, and zmq objects. Answers on this site suggest to ignore class as a compiler option: pylint --ignored-classes=some_class_name my_python_file.py You can also place this option in your pylintrc file. I don't want to do either. I'd rather stick the option within the source file. I get a complaint if I do the following: #

How do I automatically fix lint issues reported by pylint?

微笑、不失礼 提交于 2019-12-23 14:51:47
问题 Just like we have "eslint --fix" to automatically fix lint problems in Javascript code, do we have something for pylint too for Python code? 回答1: Few of the error codes reported by pylint can be fixed with below lib https://github.com/hhatto/autopep8 additionally if you are using pycharm as editor it is having option to reformat-code which will help to solve most of the issues reported by pylint 来源: https://stackoverflow.com/questions/54586757/how-do-i-automatically-fix-lint-issues-reported

pip installed pylint cannot be found

五迷三道 提交于 2019-12-23 09:49:43
问题 There's a lot of questions around this, so it might be a duplicate, but I can't find a solution, so here goes.. I want to use pylint with atom. If I use the recommended pip install --user pylint it seems to work but atom can't find and neither can I; which pylint and whereis pylint return nothing. The same thing goes if I use pip3 . If I go against wisdom and use sudo pip install pylint it is found but now I get a different error with atom: unable to determine environment . Any suggestions?

Pylint E0202 False Positive? Or is this piece of code wrong?

回眸只為那壹抹淺笑 提交于 2019-12-23 09:34:06
问题 I've been working on a class with properties but we ran into a nasty problem with pylint (0.25.1) In the code below we are defining a class with a property which were introduced in python 2.6 However, pylint whines about the fact that in the __init__ method self.aProperty will overwrite the defined method named aProperty. I've also pasted the output from the console and the output of the pylint messages. Is this a case of 'please report to the pylint devs' or is this piece of (example) code