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

Fix gen_python_files usage for black>=21.7b1.dev9 #189

Merged
merged 4 commits into from
Sep 4, 2021
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion src/darker/black_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
based on whether reformats touch user-edited lines

"""

import inspect
import logging
import sys
from pathlib import Path
Expand Down Expand Up @@ -131,6 +131,9 @@ def apply_black_excludes(
:return: Absolute paths of files which should be reformatted using Black

"""
sig = inspect.signature(gen_python_files)
# those two exist and are required in black>=21.8b0
flying-sheep marked this conversation as resolved.
Show resolved Hide resolved
kwa = dict(verbose=False, quiet=False) if "verbose" in sig.parameters else {}
flying-sheep marked this conversation as resolved.
Show resolved Hide resolved
return set(
gen_python_files(
(root / path for path in paths),
Expand All @@ -141,6 +144,7 @@ def apply_black_excludes(
force_exclude=black_config.get("force_exclude"),
report=Report(),
gitignore=None,
**kwa,
flying-sheep marked this conversation as resolved.
Show resolved Hide resolved
)
)

Expand Down