hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.

Home Page:https://pypi.org/project/autopep8/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using "--ignore=E302" and "--ignore=E305" at the same time

ppzoglou opened this issue · comments

I initially opened an issue on vscode's autopep8 extension repo but as I understand it, there is not much they can do about it so I came here. My desired outcome is for there not to be any extra (more than one) blank lines between defs, classes and the rest of the code, neither above nor bellow them. It seems like I can only achieve one of the two at any time based on what I choose to ignore last.

example

As you can see in this image, at first there are no extra blank lines. Then I format the file using ignore=E305 last resulting in there only being one extra blank line added between the function and the first print statement. After that I format it again this time with ignore=E302 being the last arg and as you can see its the exact opposite result this time, with the extra blank line being added under the function.

Environment

  • Python version: 3.10.12
  • autopep8 version: 2.0.2
  • Platform: Ubuntu 22.04.2 LTS

@ppzoglou
If you want to specify more than one, separate them by commas.
For example: --ignore=E121,E302,E305