Skip to content

inconsistency in partial formatting with Darker #529

Answered by akaihola
Eyobkibret15 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Eyobkibret15, thanks for your report!

Since Black doesn't support partial formatting natively, Darker takes a diff between the original and modified versions of the file and tries to track down which lines correspond to each other, and how they map to the reformatting made by Black. It then takes a conservative approach to apply minimal diff chunks which intersect with detected changes. Unfortunately it's very tricky to get this approach to really minimize the changes since we're not digging down to analyzing the Python code.

So unfortunately this is a known limitation which can't be approved using the current approach with reasonable effort.

Let me know if the documentation can be im…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Eyobkibret15
Comment options

Eyobkibret15 Mar 18, 2024
Collaborator Author

@akaihola
Comment options

@akaihola
Comment options

@Eyobkibret15
Comment options

Eyobkibret15 Mar 26, 2024
Collaborator Author

@akaihola
Comment options

Answer selected by akaihola
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants