9

my python code produce the following warning message:

(1) \dir\file.py:8:1 W293 blank lines contains whitespace
this comes after commands[0] flake8 XXX

how do you fix the issue?

jgritty
  • 11,660
  • 3
  • 38
  • 60
PChao
  • 417
  • 2
  • 5
  • 17

3 Answers3

16

Using the same principal from this question, you can use autopep8 to automatically fix these. The syntax is ...

    autopep8 --select=W293 --in-place your_file.py
Community
  • 1
  • 1
Mister Brainley
  • 632
  • 1
  • 7
  • 20
  • You can configure autopep8 to ignore certain error codes, either at the project or user level. For example, you could add the following lines to a `setup.cfg` in your project's directory ... `[pycodestyle]` `ignore = W293` See documentation for more info. http://pep8.readthedocs.io/en/latest/intro.html#configuration – Mister Brainley May 27 '18 at 19:06
4

Simply delete the spaces, tabs, or other white space characters from line 8 in file.py.

jgritty
  • 11,660
  • 3
  • 38
  • 60
0

Blank lines should not contain any tabs or spaces. So remove the extra spaces as per PEP8. Source - https://ayush-raj-blogs.hashnode.dev/making-clean-pr-for-open-source-contributors-pep-8-style

pythonboi
  • 11
  • 1