mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 22:34:17 +00:00
deprecate the --diff option
This commit is contained in:
parent
a08fc4be98
commit
e6579239af
3 changed files with 11 additions and 2 deletions
|
|
@ -238,6 +238,11 @@ Options and their Descriptions
|
||||||
|
|
||||||
:ref:`Go back to index <top>`
|
:ref:`Go back to index <top>`
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Due to hiding potential errors, this option is deprecated and will be
|
||||||
|
removed in a future version.
|
||||||
|
|
||||||
Use the unified diff provided on standard in to only check the modified
|
Use the unified diff provided on standard in to only check the modified
|
||||||
files and report errors included in the diff.
|
files and report errors included in the diff.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,10 @@ class Application:
|
||||||
|
|
||||||
self.running_against_diff = self.options.diff
|
self.running_against_diff = self.options.diff
|
||||||
if self.running_against_diff:
|
if self.running_against_diff:
|
||||||
|
LOG.warning(
|
||||||
|
"the --diff option is deprecated and will be removed in a "
|
||||||
|
"future version."
|
||||||
|
)
|
||||||
self.parsed_diff = utils.parse_unified_diff()
|
self.parsed_diff = utils.parse_unified_diff()
|
||||||
if not self.parsed_diff:
|
if not self.parsed_diff:
|
||||||
self.exit()
|
self.exit()
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,8 @@ def register_default_options(option_manager):
|
||||||
add_option(
|
add_option(
|
||||||
"--diff",
|
"--diff",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Report changes only within line number ranges in the unified "
|
help="(DEPRECATED) Report changes only within line number ranges in "
|
||||||
"diff provided on standard in by the user.",
|
"the unified diff provided on standard in by the user.",
|
||||||
)
|
)
|
||||||
|
|
||||||
add_option(
|
add_option(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue