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:
Ian Cordasco 2016-10-25 19:28:52 -05:00
parent 5f3577fca8
commit 68a273144e
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 20 additions and 12 deletions

View file

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