pylint

No luck pip-installing pylint for Python 3

烂漫一生 提交于 2019-12-04 05:47:01
I'm interested in running a checker over my Python 3 code to point out possible flaws. PyChecker does not work with Python 3. I tried to pip-install Pylint, but this fails. The error message does not help me (see paste) . Pylint's Readme states that: Pylint should be compatible with any python >= 2.2. However, the page somehow feels outdated. Is pylint compatible with Python 3? If yes, how can I install it? If no, are there alternatives I should look into? Yuval Adam Yes, pylint versions > 0.23.0 do support Py3K. Your issue seems to be described in http://www.logilab.org/82417 (also Getting

How to get pylint warnings to be marked in the Pydev Eclipse editor margin?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 02:41:31
I have pylint installed (works fine on the command line) and set up within Pydev in Eclipse. Pylint is being triggered OK when I edit files, and is outputting to the Eclipse console. But, the pylint warnings don't appear as marks in the editor margin (in the same way as compiler warnings and errors) Newly-generated warnings don't appear in the Problems view either - there are some old ones showing, but they disappear if I re-save the relevant module. I know this is possible as I've had it working previously - but how do I set this up? Ticking or unticking "Redirect Pylint output to console?"

python code convention using pylint

孤者浪人 提交于 2019-12-04 02:31:29
I'm trying out pylint to check my source code for conventions. Somehow some variable names are matched with the regex for constants ( const-rgx ) instead of the variable name regex ( variable-rgx ). How to match the variable name with variable-rgx ? Or should I extend const-rgx with my variable-rgx stuff? e.g. C0103: 31: Invalid name "settings" (should match (([A-Z_][A-Z1-9_]*)|(__.*__))$) Somehow some variable names are matched with the regex for constants (const-rgx) instead of the variable name regex (variable-rgx). Are those variables declared on module level? Maybe that's why they are

How can I set the Python max allowed line length to 120 in Syntastic for Vim?

我是研究僧i 提交于 2019-12-03 22:49:40
I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard. In python-mode, this is easy. I just add the following to my ~/.vimrc: " Pylint configuration file let g:pymode_lint_config = '$HOME/.pylint.rc' let g:pymode_options_max_line_length=120 This works great, but then, I also wanted to use the superb Syntastic plugin for checking syntax of various other kinds (Chef recipes for foodcritic, for example.) Unfortunately, Syntastic also does Python linting, and as such it has now started complaining about my 120 character

How to handle the pylint message: ID:W0612 Unused Variable

ぃ、小莉子 提交于 2019-12-03 22:19:36
I'm updating some code to PEP 8 standard using pylint. Part of the code is throwing the W0612 unused variable error but it's because it's using a module that returns (x,y) for example when only x is needed in this particular case, this is what's done. (var_1, var_2) = func() def func(): a="a" b="b" return (a,b) var_1 is then returned but var_2 is never used and therefore throws the error. How should I handle this? I'm thinking this var = func()[0] What is the best way to handle it? I believe that a, dummy = func() does the trick. Pylint allows (if I recall correctly) unused variables names

“Unused import warning” and pylint

醉酒当歌 提交于 2019-12-03 22:13:28
So I'm working on a project in Python and trying to keep it up to standards with pylint and just generally . So, I have a source file, (We'll just call it a.py) #a.py import loggingsetup def foo(): log.info("This is a log message") But, I want to control what the logging looks like, so in loggingsetup I have something like: #loggingsetup.py import logging logging.root.setLevel(logging.DEBUG) consoleOut = logging.StreamHandler() consoleOut.setLevel(logging.INFO) consoleOut.setFormatter(logging.Formatter("\t"+logging.BASIC_FORMAT)) logging.root.addHandler(consoleOut) #etc Now, this seems to work

How to fix: W602 deprecated form of raising exception

杀马特。学长 韩版系。学妹 提交于 2019-12-03 20:33:47
问题 If I use pylint (via sublimerlinter) I get following warning message: W602 deprecated form of raising exception This I how I use exceptions in my code: if CONDITION == True: raise ValueError, HELPING_EXPLANATION 回答1: Raise your exception like this: if CONDITION == True: raise ValueError(HELPING_EXPLANATION) From PEP 8 -- Style Guide for Python Code - Programming Recommendations: When raising an exception, use raise ValueError('message') instead of the older form raise ValueError, 'message' .

PyLint 1.0.0 with PyDev + Eclipse: “include-ids” option no longer allowed, breaks Eclipse integration

不想你离开。 提交于 2019-12-03 14:09:24
As noted in this question: How do I get Pylint message IDs to show up after pylint-1.0.0? pylint 1.0.0 no longer accepts "include-ids" option. (It returns "lint.py: error: no such option: --include-ids"). Unfortunately, in the integation with PyDev/Eclipse, there is this little nugget: "The --include-ids=y is always included...". How to disable that argument so that Pylint will work with Eclipse? [I know, other alternatives include installing an older version of Pylint or running pylint from command line without that option (which does work), but I'd like to have the integration with Eclipse.]

Visual Studio Code - removing pylint

好久不见. 提交于 2019-12-03 11:37:44
问题 Simple question - but any steps on how to remove pylint from a Windows 10 machine with Python 3.5.2 installed. I got an old version of pylint installed that's spellchecking on old Python 2 semantics and it's bugging the heck out of me when the squigglies show up in Visual Studio Code. 回答1: open the workspace settings file (select File > Preferences > Settings, then locate Python configuration) and edit this line as "python.linting.pylintEnabled": false then save the file. 回答2: If you just

Disable all `pylint` 'Convention' messages

安稳与你 提交于 2019-12-03 10:14:34
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, pylint would be much more usable for me. How does one disable these 'convention' messages? My own efforts I've tried putting disable-msg=C301 in ~/.pylintrc (which is being loaded because when I put an error in there pylint complains) which I understand to be the "Line too Long