Skip to content

Conflict with Black formatter (sublack) #16

@AlessioQuercia

Description

@AlessioQuercia

I am using sublack to format my code on save with Black formatter, and I noticed that formatting the code according to Black "breaks the created breakpoints". Steps to reproduce the conflict (assuming both sublack and PythonBreakpoints packages are installed):

  • create a breakpoint
  • format the code using sublack
  • the breakpoint will be split into two different lines

A possible solution is to surround the code for the breakpoint with "# fmt: off / # fmt: on" in the following way:

\# fmt: off
import pdb; pdb.set_trace()  # breakpoint aff323e8 //
\# fmt: on

I thought that there could be a flag to allow people using Black formatter to add the above lines of code instead of the original one.

I kind of implemented this, but it is still buggy. It seems that sublack interferes with this as well. It would be nice to force Black to ignore those lines. Do you think it is possible somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions