deprecate the --diff option

This commit is contained in:
Anthony Sottile 2021-11-05 20:49:19 -04:00
parent a08fc4be98
commit e6579239af
3 changed files with 11 additions and 2 deletions

View file

@ -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.

View file

@ -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()

View file

@ -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(