Skip to content

# yapf: disable ignored when --lines is specified in v0.31.0 #913

Closed

Description

@phoenix-meadowlark

# yapf: disable is being ignored by some formatting rules when --lines is specified in version 0.31.0 :

# yapf_lines_bug.py
# yapf: disable
def outer_func():
    def inner_func():
        return
    return
# yapf: enable
python -m yapf -i yapf_lines_bug.py
# yapf_lines_bug.py
# yapf: disable
def outer_func():
    def inner_func():
        return
    return
# yapf: enable
# --lines 1-8 corresponds to the entire file
python -m yapf -i yapf_lines_bug.py --lines 1-8
# yapf_lines_bug.py
# yapf: disable
def outer_func():
    def inner_func():
        return

    return
# yapf: enable

This is a regression from the behavior of version 0.30.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions