Skip to content
Open
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 flake8_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def load_black_mode(toml_filename=None):
line_length=int(black_config.get("line_length", black.DEFAULT_LINE_LENGTH)),
string_normalization=not black_config.get("skip_string_normalization", False),
magic_trailing_comma=not black_config.get("skip_magic_trailing_comma", False),
enable_unstable_feature=config.get("enable_unstable_feature", []),
unstable=config.get("unstable", False),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/psf/black/blob/25.1.0/src/black/mode.py#L226 which defines the class and https://github.com/psf/black/blob/main/src/black/__init__.py#L626 which initializes it - that's what we try to copy.

This does have unstable as a boolean, but uses enabled_features=set(enable_unstable_feature) (a different argument name to what you are trying).

preview=bool(black_config.get("preview", False)),
)

Expand Down