Skip to content

Commit

Permalink
feat: block autofix when using flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
guilatrova committed Sep 12, 2021
1 parent 5bc9cc7 commit 77d6af3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tryceratops/flake_plugin.py
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 77d6af3

Please sign in to comment.