X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ad1696422b7343a0cfea3c4b304e6acfa15d3cff..5918a016ff82e5fa12097d07b1624a89ec4e60ac:/src/black/__init__.py?ds=sidebyside diff --git a/src/black/__init__.py b/src/black/__init__.py index 1c69cc4..cf25787 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -755,6 +755,8 @@ def reformat_one( is_stdin = False if is_stdin: + if src.suffix == ".pyi": + mode = replace(mode, is_pyi=True) if format_stdin_to_stdout(fast=fast, write_back=write_back, mode=mode): changed = Changed.YES else: @@ -5759,6 +5761,13 @@ def is_simple_decorator_trailer(node: LN, last: bool = False) -> bool: and node.children[0].type == token.DOT and node.children[1].type == token.NAME ) + # last trailer can be an argument-less parentheses pair + or ( + last + and len(node.children) == 2 + and node.children[0].type == token.LPAR + and node.children[1].type == token.RPAR + ) # last trailer can be arguments or ( last