@click.option(
"--pyi",
is_flag=True,
- help="Force pyi (stub file) formatting, regardless of file extension.",
+ help=(
+ "Consider all input files typing stubs regardless of file extension "
+ "(useful when piping source on standard input)."
+ ),
)
@click.option(
"--py36",
is_flag=True,
help=(
- "Force Python 3.6 mode, even if file doesn't currently use "
- "Python 3.6-only syntax."
+ "Allow using Python 3.6-only syntax on all input files. This will put "
+ "trailing commas in function signatures and calls also after *args and "
+ "**kwargs. [default: per-file auto-detection]"
),
)
@click.version_option(version=__version__)
and second_leaf.value == "def"
)
- @property
- def is_flow_control(self) -> bool:
- """Is this line a flow control statement?
-
- Those are `return`, `raise`, `break`, and `continue`.
- """
- return (
- bool(self)
- and self.leaves[0].type == token.NAME
- and self.leaves[0].value in FLOW_CONTROL
- )
-
- @property
- def is_yield(self) -> bool:
- """Is this line a yield statement?"""
- return (
- bool(self)
- and self.leaves[0].type == token.NAME
- and self.leaves[0].value == "yield"
- )
-
@property
def is_class_paren_empty(self) -> bool:
"""Is this a class with no base classes but using parentheses?
"""Return the number of extra empty lines before and after the `current_line`.
This is for separating `def`, `async def` and `class` with extra empty
- lines (two on module-level), as well as providing an extra empty line
- after flow control keywords to make them more prominent.
+ lines (two on module-level).
"""
if isinstance(current_line, UnformattedLines):
return 0, 0