From e6579239af8b37e6cae2f515609d3ca56573e4b2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 5 Nov 2021 20:49:19 -0400 Subject: [PATCH] deprecate the --diff option --- docs/source/user/options.rst | 5 +++++ src/flake8/main/application.py | 4 ++++ src/flake8/main/options.py | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst index 9cdb0ee..e82b0b6 100644 --- a/docs/source/user/options.rst +++ b/docs/source/user/options.rst @@ -238,6 +238,11 @@ Options and their Descriptions :ref:`Go back to index ` + .. 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 files and report errors included in the diff. diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index 44a5524..76c8078 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -191,6 +191,10 @@ class Application: self.running_against_diff = self.options.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() if not self.parsed_diff: self.exit() diff --git a/src/flake8/main/options.py b/src/flake8/main/options.py index 2a214a7..470f430 100644 --- a/src/flake8/main/options.py +++ b/src/flake8/main/options.py @@ -146,8 +146,8 @@ def register_default_options(option_manager): add_option( "--diff", action="store_true", - help="Report changes only within line number ranges in the unified " - "diff provided on standard in by the user.", + help="(DEPRECATED) Report changes only within line number ranges in " + "the unified diff provided on standard in by the user.", ) add_option(