Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with black-22.10.1.dev19+gffaaf48 #404

Merged
merged 2 commits into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Added

Fixed
-----
- Fix compatibility with ``black-22.10.1.dev19+gffaaf48`` and later – an argument was
replaced in ``black.files.gen_python_files()`.


1.5.1_ - 2022-09-11
Expand Down
5 changes: 4 additions & 1 deletion src/darker/black_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def filter_python_files(
sig = inspect.signature(gen_python_files)
# those two exist and are required in black>=21.7b1.dev9
kwargs = dict(verbose=False, quiet=False) if "verbose" in sig.parameters else {}
# `gitignore=` was replaced with `gitignore_dict=` in black==22.10.1.dev19+gffaaf48
for param in sig.parameters:
if param.startswith("gitignore"):
kwargs[param] = None # type: ignore[assignment]
absolute_paths = {p.resolve() for p in paths}
directories = {p for p in absolute_paths if p.is_dir()}
files = {p for p in absolute_paths if p not in directories}
Expand All @@ -147,7 +151,6 @@ def filter_python_files(
extend_exclude=black_config.get("extend_exclude"),
force_exclude=black_config.get("force_exclude"),
report=Report(),
gitignore=None,
**kwargs,
)
)
Expand Down