madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged.
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e7a4429)
black [OPTIONS] [SRC]...
Options:
black [OPTIONS] [SRC]...
Options:
+ -c, --code TEXT Format the code passed in as a string.
-l, --line-length INTEGER How many characters per line to allow.
[default: 88]
-t, --target-version [py27|py33|py34|py35|py36|py37|py38]
-l, --line-length INTEGER How many characters per line to allow.
[default: 88]
-t, --target-version [py27|py33|py34|py35|py36|py37|py38]
* fix feature detection for trailing commas in function definitions and
call sites (#763)
* fix feature detection for trailing commas in function definitions and
call sites (#763)
+* add `black -c` as a way to format code passed from the command line (#761)
+
* fix bug that led *Black* format some code with a line length target of 1
(#762)
* fix bug that led *Black* format some code with a line length target of 1
(#762)
@click.command(context_settings=dict(help_option_names=["-h", "--help"]))
@click.command(context_settings=dict(help_option_names=["-h", "--help"]))
+@click.option("-c", "--code", type=str, help="Format the code passed in as a string.")
@click.option(
"-l",
"--line-length",
@click.option(
"-l",
"--line-length",
@click.pass_context
def main(
ctx: click.Context,
@click.pass_context
def main(
ctx: click.Context,
line_length: int,
target_version: List[TargetVersion],
check: bool,
line_length: int,
target_version: List[TargetVersion],
check: bool,
)
if config and verbose:
out(f"Using configuration from {config}.", bold=False, fg="blue")
)
if config and verbose:
out(f"Using configuration from {config}.", bold=False, fg="blue")
+ if code is not None:
+ print(format_str(code, mode=mode))
+ ctx.exit(0)
try:
include_regex = re_compile_maybe_verbose(include)
except re.error:
try:
include_regex = re_compile_maybe_verbose(include)
except re.error: