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

Add "preview" and "skip-magic-trailing-comma" options, and version bump to v0.2.5 #48

Merged
merged 2 commits into from Feb 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.rst
Expand Up @@ -175,6 +175,9 @@ Version History
======= ============ ===========================================================
Version Release date Changes
------- ------------ -----------------------------------------------------------
v0.2.5 2022-02-23 - Support options "preview", "skip-magic-trailing-comma",
contribution from
`Ferdy <https://github.com/ferdynice>`_.
v0.2.4 2022-01-30 - Support black v22.1.0 which changed a function call,
contribution from
`Raffaele Salmaso <https://github.com/rsalmaso>`_.
Expand Down
6 changes: 5 additions & 1 deletion flake8_black.py
Expand Up @@ -14,7 +14,7 @@
from flake8 import LOG


__version__ = "0.2.4"
__version__ = "0.2.5"

black_prefix = "BLK"

Expand Down Expand Up @@ -51,6 +51,8 @@ def load_black_mode(toml_filename=None):
target_versions=set(),
line_length=black.DEFAULT_LINE_LENGTH, # Expect to be 88
string_normalization=True,
magic_trailing_comma=True,
preview=False,
)

LOG.info("flake8-black: loading black settings from %s", toml_filename)
Expand All @@ -70,6 +72,8 @@ def load_black_mode(toml_filename=None):
},
line_length=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),
preview=black_config.get("preview", False),
)


Expand Down