Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: pylint woes Date: Sat, 7 May 2016 15:40:23 -0400 Lines: 99 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de WRkQfi0okxWMGlr3K/HAZAb9KOJf+LFwmkHER6A5JPgw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'warnings': 0.03; 'fixes': 0.05; 'installed.': 0.05; 'feature.': 0.07; 'newline': 0.07; 'trailing': 0.07; 'check.': 0.09; 'fix.': 0.09; 'imports': 0.09; 'pyodbc': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'release,': 0.09; 'tab': 0.09; 'bug': 0.10; 'jan': 0.11; '"your': 0.16; 'accessible,': 0.16; 'dfs': 0.16; 'docstring': 0.16; 'idlelib': 0.16; 'macro': 0.16; 'member"': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'reorder': 0.16; 'skip:| 20': 0.16; 'somewhere.': 0.16; 'statments': 0.16; 'wrote:': 0.16; 'copied': 0.18; 'skip:+ 40': 0.18; ';-)': 0.18; 'variable': 0.18; 'first,': 0.20; 'fix': 0.21; 'disable': 0.22; 'strip': 0.22; 'suppose': 0.22; 'tkinter': 0.22; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'header :User-Agent:1': 0.26; 'appear': 0.26; 'command': 0.26; 'header:X -Complaints-To:1': 0.26; 'object,': 0.27; 'this.': 0.28; "skip:' 10": 0.28; 'consistency': 0.29; 'disabling': 0.29; 'helpful.': 0.29; 'pep': 0.29; 'whitespace': 0.29; "i'm": 0.30; 'comments': 0.30; 'you?': 0.30; 'code': 0.30; 'skip:- 30': 0.32; 'says': 0.32; 'compiled': 0.32; 'source': 0.33; 'editor': 0.34; 'this?': 0.34; 'could': 0.35; 'files,': 0.35; 'replace': 0.35; 'comment': 0.35; 'sometimes': 0.35; 'but': 0.36; 'should': 0.36; 'modules': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:org': 0.37; 'missing': 0.37; 'things': 0.38; 'doing': 0.38; 'difference': 0.38; 'files': 0.38; 'end': 0.39; 'why': 0.39; 'format': 0.39; 'does': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'yes': 0.62; 'received:96': 0.63; 'latest': 0.64; 'between': 0.65; 'believe': 0.66; 'worth': 0.67; 'saving': 0.70; 'guideline': 0.84; 'habit.': 0.84; 'happier': 0.84; 'order:': 0.84; 'rated': 0.84; 'skip:| 10': 0.84; 'surround': 0.84; '|message': 0.84; 'comment.': 0.91; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:108290 On 5/7/2016 12:51 PM, DFS wrote: > This more-anal-than-me program generated almost 2 warnings for every > line of code in my program. w t hey? If you don't like it, why do you use it? I suppose the answer is that it did find a few things to check. You might be happier with pychecker, which is much less aggressive. I believe will find the things you did fix. > DFS comments > +-------------------------+------------+ ------------------------------- > |message id |occurrences | > +=========================+============+ > |mixed-indentation |186 | I always use tab > +-------------------------+------------+ > |invalid-name |82 | every single variable name?! I would need examples to comment. > +-------------------------+------------+ > |trailing-whitespace |59 | heh! Any code editor should have a command to fix this. IDLE: Format => strip trailing whitespace Notepad++: Macro => trim trailing and save, Alt-Shift-S others ... > +-------------------------+------------+ > |no-member |5 | > > "Module 'pyodbc' has no 'connect' member" Yes it does. > "Module 'pyodbc' has no 'Error' member" Yes it does. > > Issue with pylint, or pyodbc? Worth looking into. Could be a bug somewhere. But I don't have pyodbc installed. > +-------------------------+------------+ > |line-too-long |5 | meh For following the PEP guideline when patching CPython, this is helpful. > +-------------------------+------------+ > |wrong-import-order |4 | does it matter? Consistency in imports ultimately makes easier reading. Many idlelib files use this order: stdlib modules other than tkinter and idlelib (alphabetically); tkinter (tkinter first, then submodules); idlelib (alphabetically). When I edit files, I sometimes reorder imports to conform. > +-------------------------+------------+ > |missing-docstring |4 | what's the difference between > a docstring and a # comment? # Comments only appear in the source '''Docstrings are copied to the compiled code object, are interactively accessible, and are used for help(ojb) output.''' > +-------------------------+------------+ > |superfluous-parens |3 | I like to surround 'or' > statments with parens I would need examples to comment > +-------------------------+------------+ > |bad-builtin |2 | warning because I used filter? If they are still doing this in the latest release, it is an arrogance and inconsistency bug on their part. Disable this check. > +-------------------------+------------+ > |missing-final-newline |1 | I'm using Notepad++, with > EOL Conversion set to > 'Windows Format'. That says to replace final '\n' with '\r\n'. It does not affect a missing final newline ;-) How or should I fix this? Fix by hitting 'Enter' at the end of the last line. Should you? I think it a good habit. > After fixes and disabling various warnings: > "Your code has been rated at 8.37/10" Being able to customize pylint by turning off warnings is its saving feature. -- Terry Jan Reedy