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

Remove deprecated --py36 option #1236

Merged
merged 2 commits into from
May 8, 2020
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: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
additional_dependencies: [flake8-bugbear]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.740
rev: v0.761
hooks:
- id: mypy
exclude: ^docs/conf.py
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ Options:
Python versions that should be supported by
Black's output. [default: per-file auto-
detection]
--py36 Allow using Python 3.6-only syntax on all
input files. This will put trailing commas
in function signatures and calls also after
*args and **kwargs. Deprecated; use
--target-version instead. [default: per-file
auto-detection]
--pyi Format all input files like typing stubs
regardless of file extension (useful when
piping source on standard input).
Expand Down
22 changes: 1 addition & 21 deletions black.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,6 @@ def target_version_option_callback(
" auto-detection]"
),
)
@click.option(
"--py36",
is_flag=True,
help=(
"Allow using Python 3.6-only syntax on all input files. This will put trailing"
" commas in function signatures and calls also after *args and **kwargs."
" Deprecated; use --target-version instead. [default: per-file auto-detection]"
),
)
@click.option(
"--pyi",
is_flag=True,
Expand Down Expand Up @@ -476,7 +467,6 @@ def main(
color: bool,
fast: bool,
pyi: bool,
py36: bool,
skip_string_normalization: bool,
quiet: bool,
verbose: bool,
Expand All @@ -488,17 +478,7 @@ def main(
"""The uncompromising code formatter."""
write_back = WriteBack.from_configuration(check=check, diff=diff, color=color)
if target_version:
if py36:
err("Cannot use both --target-version and --py36")
ctx.exit(2)
else:
versions = set(target_version)
elif py36:
err(
"--py36 is deprecated and will be removed in a future version. Use"
" --target-version py36 instead."
)
versions = PY36_VERSIONS
versions = set(target_version)
else:
# We'll autodetect later.
versions = set()
Expand Down