google / google/yapf

yapf-diff inconsistent with yapf on multiline strings with backslashes

Open
#1,214 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

If I run yapf over my files, yapf says all is good.

But I run yapf-diff over my PR diff, yapf-diff is generating some unexpected auto-format changes, with lots of unnecessary spaces:

File 1
![image](https://github.com/google/yapf/assets/121044623/854f4fad-55c0-4941-be35-ebada7b019bd)

File 2
![image](https://github.com/google/yapf/assets/121044623/294721b8-a487-488e-9148-cdd00773f235)

Could this be a specific bug related to multiline strings that use backlashes?

Note: My PR has over a thousand files and these were the only unexpected yapf-diff changes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.