Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
10 tasks done
endolith opened this issue Aug 4, 2019 · 6 comments
Open
10 tasks done

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

endolith opened this issue Aug 4, 2019 · 6 comments

Comments

@endolith
Copy link

endolith commented Aug 4, 2019

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)
@ccordoba12
Copy link
Member

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

@endolith
Copy link
Author

endolith commented Aug 6, 2019

Will it just block all of a particular error though? Because they are useful everywhere else except tables of data

@goanpeca
Copy link
Member

goanpeca commented Aug 6, 2019

Will it just block all of a particular error though? Because they are useful everywhere else except tables of data

all of a particular error

Yes

Because they are useful everywhere else except tables of data

This should be probably implemented on the linter side and not on spyder.

@endolith
Copy link
Author

endolith commented Aug 7, 2019

@goanpeca I asked pycodestyle and they said it's downstream's responsibility. :/

@ccordoba12
Copy link
Member

@goanpeca, how do you think we could address this one? Probably with a regex that detects nested lists of data?

@goanpeca
Copy link
Member

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

Not sure how we can handle this :-|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants