question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint Inline Comment - Disabling statement doesn't work

See original GitHub issue

Description

What steps will reproduce the problem?

FileName: issue_sample.py

FileContent:

# pylint: disable=E501

print('lorem ipsum Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')

Code Analysis is activated in the global spyder settings. I want now disable some linter options like “line to long” … I have added in the first line a pylint settings comment, but it doesn’t work. The editor is still showing the warning symbol, in the case of too long rows.

Is this a config/syntax issue from myside or an general defect/bug…

Please help!

thanks Marcus

Versions

  • Spyder version: 3.3.1
  • Python version: 3.6.5
  • Qt version: 5.9.4
  • PyQt5 version: 5.9.2
  • Operating System: Darwin 17.7.0

Dependencies

pyflakes >=0.6.0  :  1.6.0 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.7.4 (OK)
rope >=0.9.4      :  0.10.7 (OK)
jedi >=0.9.0      :  0.12.0 (OK)
psutil >=0.3      :  5.4.5 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
pandas >=0.13.1   :  0.23.0 (OK)
numpy >=1.7       :  1.14.3 (OK)
sympy >=0.7.3     :  1.1.1 (OK)
cython >=0.21     :  0.28.2 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
IPython >=4.0     :  6.4.0 (OK)
matplotlib >=2.0.0:  2.2.2 (OK)
pylint >=0.25     :  1.8.4 (OK)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ccordoba12commented, Jun 23, 2021

There are three things here:

  1. We don’t use Pylint to lint our files in real time but Pyflakes, so using Pylint messages has no effect.
  2. Pylint is used in our Code Analysis pane, where comments like # pylint: disable=E501 do have effect.
  3. To ignore linting messages we plan to use # noqa standard or # analysis:ignore (which was supported in Spyder 3).

Point 3 was reported on issue #11033, so I’m going to close this one as duplicate of that. And we plan to fix #11033 in 5.1.0, to be released at the end of July.

0reactions
igurin-invncommented, Jun 23, 2021

Your example works for me (E501), but “something like” it doesn’t.

image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I disable a Pylint warning? - python
These look like some statement # pylint: disable=broad-except (extra comment on the end of the original source line) and apply only to the...
Read more >
Messages control - Pylint 2.16.0-dev documentation
This describes how the pragma controls operate at a code level. The pragma controls can disable / enable: All the violations on a...
Read more >
How to ignore pylint problem for a specific single line of code
you can ignore it by adding a comment in the format # pylint: disable=[problem-code] at the end of the line where [problem-code] is...
Read more >
Pylint features — Pylint 1.5.4 documentation
In Python 3 porting mode, all checkers will be disabled and only messages emitted ... Multiple imports on one line (%s) Used when...
Read more >
Google Python Style Guide
Pylint disable comments. (e.g.: # pylint: disable=invalid-name ). Do not use backslash line continuation except for with statements requiring three or more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found