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.

Request: Don't show PEP8 errors for tables of data

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder with “Real-time code style analysis” turned on shows code style errors for tables of numbers that are formatted in a neat, readable way:

image

image

which encourages re-formatting them in a less readable way (which is contrary to the intent of PEP8):

image

image

These examples are from SciPy, for example. I asked if this exception could be added to the pycodestyle/pep8 library itself, but they will not add it. They say to use flake8 instead and modify its rules. It would be nice if something like this could be done in Spyder.

What steps reproduce the problem?

  1. Turn on real-time code style analysis
  2. Copy a numpy array from the interpreter to the code editor pane
  3. Save the file

What is the expected output? What do you see instead?

It shows code style problems for code that is more-readable, and does not show them for code that is less readable.

Versions

  • Spyder version: 3.3.5
  • Python version: 3.7.3 64-bit
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 7 Pro 64-bit

Dependencies

IPython >=4.0     :  7.6.1 (OK)
cython >=0.21     :  0.29.12 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
matplotlib >=2.0.0:  3.0.3 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
numpy >=1.7       :  1.16.2 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pyflakes >=0.6.0  :  2.1.1 (OK)
pygments >=2.0    :  2.4.2 (OK)
pylint >=0.25     :  2.3.1 (OK)
qtconsole >=4.2.0 :  4.5.1 (OK)
rope >=0.9.4      :  0.14.0 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
sympy >=0.7.3     :  1.4 (OK)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Aug 6, 2019

Thanks for reporting. You’ll be able to select what pep8 message you want to see/hide in Spyder 4.

0reactions
goanpecacommented, Aug 13, 2019

@goanpeca, how do you think we could address this one?

Not sure how we can handle this 😐

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 8 – Style Guide for Python Code
Table of Contents ... And don't hesitate to ask! ... Python mandates that future-imports must appear in the module before any other code ......
Read more >
python - VS Code doesn't recognize pep8 - Stack Overflow
I already installed Python for VSCode . and I installed flake8 , but I got same error. I'll add plugins info to my...
Read more >
How to Write Beautiful Python Code With PEP 8 - Real Python
Learn how to write high-quality, readable code by using the Python style guidelines laid out in PEP 8. Following these guidelines helps you...
Read more >
Linting Python in Visual Studio Code
Linting highlights syntactical and stylistic problems in your Python source code, which often helps you identify and correct subtle programming errors or ...
Read more >
Long-awaited PEP 8 checks on the fly, improved doctest ...
I noticed that pep8 does show up in the code inspection tab. I had it set to ERROR so it under lines any...
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