Merge pull request #1441 from asottile/deprecate_diff

deprecate the --diff option
This commit is contained in:
Ian Stapleton Cordasco 2021-11-06 06:03:53 -05:00 committed by GitHub
commit e34647fb37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(