From 77d6af33b60bef51f7f0a5ed80ee6f0965d57856 Mon Sep 17 00:00:00 2001 From: Guilherme Latrova Date: Sun, 12 Sep 2021 15:08:23 -0300 Subject: [PATCH] feat: block autofix when using flake8 --- src/tryceratops/flake_plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tryceratops/flake_plugin.py b/src/tryceratops/flake_plugin.py index 7f0eedf..4b432d3 100644 --- a/src/tryceratops/flake_plugin.py +++ b/src/tryceratops/flake_plugin.py @@ -10,7 +10,9 @@ from tryceratops.violations.violations import Violation PACKAGE_NAME = "tryceratops" -GLOBAL_DUMMY_FILTER = GlobalFilter(False, ignore_violations=[], exclude_dirs=[]) +GLOBAL_DUMMY_FILTER = GlobalFilter( + include_experimental=False, ignore_violations=[], exclude_dirs=[], autofix=False +) FLAKE8_VIOLATION_TYPE = Tuple[int, int, str, Type[Any]] # line, offset, message, class @@ -36,7 +38,9 @@ def __init__( def _create_global_filter(self, filename: str) -> GlobalFilter: pyproj_config = load_config([filename]) if pyproj_config: - return GlobalFilter.create_from_config(pyproj_config) + filter = GlobalFilter.create_from_config(pyproj_config) + filter.autofix = False # Do not allow this option for flake8 to avoid confusion + return filter return GLOBAL_DUMMY_FILTER