pylint

Imports failing in VScode for pylint when importing pygame

元气小坏坏 提交于 2019-12-18 07:23:55
问题 When importing pygame pylint is going crazy: E1101:Module 'pygame' has no 'init' member E1101:Module 'pygame' has no 'QUIT' member I have searched the net and I have found this: "python.linting.pylintArgs": ["--ignored-modules=pygame"] It solves the problem with pygame, but now pylint is going crazy in other way: crazy_pylint.png. Then I have found "python.linting.pylintArgs": ["--ignored-files=pygame"] , but what it does is completely disabling pylint for the whole directory I am working in.

How to specify a configuration file for pylint under windows?

﹥>﹥吖頭↗ 提交于 2019-12-18 04:30:12
问题 I am evaluating pylint as source code checker and I would like to customize the maximum number of characters on a single line. I would like to use a configuration file. I've generated a template thanks to the --generate-rcfile command and I've made my modification. I am trying to run pylint --rcfile=myfile.rc but I can see that my changes are not taken into account by pylint. I've tried different location for my file : \Python26\Scripts\ and pylint.d in my user folder without any success.

List of pylint human readable message ids?

大城市里の小女人 提交于 2019-12-17 16:25:06
问题 Recent versions of pylint allow for suppressing messages with human readable message ids. For example, instead of class MyTest(unittest.TestCase): # pylint: disable=R0904 ... you can specify: class MyTest(unittest.TestCase): # pylint: disable=too-many-public-methods ... This page lists the numeric message ids. However, I'm looking for a complete list of the human readable versions of the message ids. Where can I find that list? 回答1: I don't think there exists (yet) such list on the web,

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

懵懂的女人 提交于 2019-12-17 15:35:14
问题 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 a .pylintrc for this project so answers changing a config file will be accepted. Otherwise, something like this will also be appreciated: import config.logging_settings # pylint: disable-this-line

PyLint “Unable to import” error - how to set PYTHONPATH?

十年热恋 提交于 2019-12-17 03:51:25
问题 I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie. __init__.py myapp.py one.py subdir\ __init__.py two.py Inside two.py I have import one and this works fine at runtime, because the top-level directory (from which myapp.py is run) is in the Python path. However, when I run PyLint on two.py it gives me an error: F0401: Unable to import 'one' How do I fix this? 回答1: There are two

Seek python warning for a multiply defined function

故事扮演 提交于 2019-12-14 04:23:21
问题 Q: is there a way to get Python to give me a warning when there is more than one definition of the same function, conflicting, etc. (I just wasted a bit of time making edits to two different versions of the same function.) A small example of conflicting function definitions: $> cat ./foo2.py cat ./foo2.py def foo(): print "1st definition of foo()" def foo(): print "2nd definition of foo()" foo() Executing - Python uses the last definition. (By the way, is that officially defined? It is useful

Avoiding a pylint warning about dash in python script name

一笑奈何 提交于 2019-12-13 20:22:33
问题 I'm trying to fix all pylint warnings for my code, and there is just one that I cannot fix without disabling the warning or renaming the script: C: 1, 0: Invalid module name "foo-bar" (invalid-name) Renaming the script is not an option since its name is its public interface. The script is widely used under the current name. That's a top-level program. The file is not intended to be used as a module. If I decide to import it as a module for unit tests, I can use __import__("foo-bar") but no

Cannot install pylint in Git Bash on Windows (Windows Store)

自闭症网瘾萝莉.ら 提交于 2019-12-13 03:26:21
问题 I installed Python 3.7 via the Windows Store. I have selected this runtime environment in VScode, and VScode insists on nagging me about installing the pylint addon (or another linting addon). It attempts to run this command in a Git Bash terminal (MINGW64): $ C:/Users/rjamd/AppData/Local/Microsoft/WindowsApps/python.exe -m pip install -U pylint --user ...which is denied permission to run: bash: C:/Users/rjamd/AppData/Local/Microsoft/WindowsApps/python.exe: Permission denied Seems like they

how can i retrieve column offsets for pylint messages?

半世苍凉 提交于 2019-12-13 00:06:23
问题 i want to format the output of pylint myself, so i'm calling pylint.lint.Run directly, and receiving callbacks to my add_message method. pretty smooth process, but i need the column offset for the messages to build my output (i'm highlighting sections of the offending lines). pylint reports the line number of each message, where appropriate. however, it seems that pylint does not report any offset information - so it isn't reporting where in the line the problem was detected. under the hood

Getting started with Pylint for Jython (jython2.5.1)

一世执手 提交于 2019-12-12 14:11:15
问题 We have a ton of Jython scripts for our deployment automation; I'd like Pylint to be part of our build pipeline. I downloaded and installed logilab-astng, logilab-common and pylint from here: http://www.logilab.org/857 I installed the logilab libraries successfully using: jython setup.py install However, when I attempt to install pylint i get the following output: C:\temp\pylint-0.22.0.tar.gz\pylint-0.22.0>jython setup.py install running install running build running build_py package init