Skip to content

Darker changes lines when the previous lines got changed #388

Open
@wkentaro

Description

@wkentaro

Describe the bug

  • Darker changes lines when the previous lines got changed.
  • It happens when there are trailing closing parenthesis of the function call.

To Reproduce

darker_tests.zip

unzip darker_tests.zip
cd darker_tests
git --no-pager diff
darker -l 79 spam.py --diff

Expected behavior

  • Only the line that was changed by editing gets updated. (in the below screenshot, only the first call of func1)

Screenshots
image

Environment (please complete the following information):

  • OS: macOS
  • Python version: 3.9.10
  • Git version [e.g. 2.36.0]
% git --version
git version 2.32.1 (Apple Git-133)
hub version refs/heads/master
  • Darker version [e.g. 1.5.0]
% darker --version
1.5.0
  • Black version [e.g. 22.3.0]
% black --version
black, 22.1.0 (compiled: yes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions