mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 20:46:54 +00:00
Fix bug with --enable-extensions
We went through an iteration where we supported --enable-extensions and then didn't. This adds back our support for --enable-extensions. Closes #239
This commit is contained in:
parent
5f3577fca8
commit
68a273144e
2 changed files with 20 additions and 12 deletions
|
|
@ -65,6 +65,7 @@ class StyleGuide(object):
|
|||
self._selected = tuple(options.select)
|
||||
self._extended_selected = tuple(options.extended_default_select)
|
||||
self._ignored = tuple(options.ignore)
|
||||
self._enabled_extensions = tuple(options.enable_extensions)
|
||||
self._decision_cache = {}
|
||||
self._parsed_diff = {}
|
||||
|
||||
|
|
@ -81,10 +82,10 @@ class StyleGuide(object):
|
|||
Ignored.Implicitly if the selected list is not empty but no match
|
||||
was found.
|
||||
"""
|
||||
if not self._selected:
|
||||
if not (self._selected or self._enabled_extensions):
|
||||
return Selected.Implicitly
|
||||
|
||||
if code.startswith(self._selected):
|
||||
if code.startswith(self._selected + self._enabled_extensions):
|
||||
return Selected.Explicitly
|
||||
|
||||
# If it was not explicitly selected, it may have been implicitly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue