google / google/yapf

YADF Dedent comment bloc

Open
#1,262 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

I have commented out lines that are indented (example of a function). When I run yapf, the comment lines are unindented and aligned with the indentation of the first line.

Source File
![Image](https://github.com/user-attachments/assets/055cc997-6563-46cc-a88d-9d38c85b4c25)

Formatage YAPF
![Image](https://github.com/user-attachments/assets/7488af29-b9bf-4201-83bb-aea343e8d9b6)

How can I keep the indentation of commented lines?
Can yapf ignore all commented lines?

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.