]>
git.madduck.net Git - etc/vim.git/blobdiff - black.py
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:
- ctx: click.Context, param: click.Parameter, value: Union[str, int, bool, None ]
+ ctx: click.Context, param: click.Parameter, value: Optional[str ]
) -> Optional[str]:
"""Inject Black configuration from "pyproject.toml" into defaults in `ctx`.
Returns the path to a successfully found and read configuration file, None
otherwise.
"""
) -> Optional[str]:
"""Inject Black configuration from "pyproject.toml" into defaults in `ctx`.
Returns the path to a successfully found and read configuration file, None
otherwise.
"""
- assert not isinstance(value, (int, bool)), "Invalid parameter type passed"
if not value:
value = find_pyproject_toml(ctx.params.get("src", ()))
if value is None:
if not value:
value = find_pyproject_toml(ctx.params.get("src", ()))
if value is None:
if not config:
return None
if not config:
return None
- if ctx.default_map is None:
- ctx.default_map = {}
- ctx.default_map.update(config) # type: ignore # bad types in .pyi
+ default_map: Dict[str, Any] = {}
+ if ctx.default_map:
+ default_map.update(ctx.default_map)
+ default_map.update(config)
+
+ ctx.default_map = default_map
@click.option(
"--config",
type=click.Path(
@click.option(
"--config",
type=click.Path(
- exists=True, file_okay=True, dir_okay=False, readable=True, allow_dash=False
+ exists=True,
+ file_okay=True,
+ dir_okay=False,
+ readable=True,
+ allow_dash=False,
+ path_type=str,
),
is_eager=True,
callback=read_pyproject_toml,
),
is_eager=True,
callback=read_pyproject_toml,