You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately this is by design. The algorithm Darker uses to narrow down the set of lines to reformat is based on diff chunks. In your example case the corrected indentation forms a contiguous chunk of changed lines, and Darker is unable to figure out the smallest valid set of lines to reformat.
There has been some exploration of improvement to this behavior, but unfortunately the amount of work would be massive (have Darker understand Python syntax), and some blocking questions couldn't be resolved. See #388 for earlier discussions, this particular comment for another example of indentation reformatting, and #221 for the failed attempt to solve this.
Describe the bug
Darker yields more reformat changes than expected. See repro steps for details.
To Reproduce
Steps to reproduce the behavior:
Let's have a code snippet with inconsistent format
Apply some changes
Run darker with
Check darker's output diff
Expected behavior
Darker should only reformat issues in the string literal that I modified.
Screenshots
If applicable, add copy/paste the output or attach a screenshots to help explain your problem.
Environment (please complete the following information):
isort==5.10.1
,flynt==1.0.1
]Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: