Skip to content

Commit

Permalink
Do not depend on pycodestyle (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Apr 24, 2018
1 parent 0ddfa44 commit f83f6b5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pyls/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import pluggy

from pyls import _utils, hookspecs, uris, PYLS
from .flake8_conf import Flake8Config
from .pycodestyle_conf import PyCodeStyleConfig


log = logging.getLogger(__name__)

Expand All @@ -25,10 +22,17 @@ def __init__(self, root_uri, init_opts):
self._settings = {}
self._plugin_settings = {}

self._config_sources = {
'flake8': Flake8Config(self._root_path),
'pycodestyle': PyCodeStyleConfig(self._root_path)
}
self._config_sources = {}
try:
from .flake8_conf import Flake8Config
self._config_sources['flake8'] = Flake8Config(self._root_path)
except ImportError:
pass
try:
from .pycodestyle_conf import PyCodeStyleConfig
self._config_sources['pycodestyle'] = PyCodeStyleConfig(self._root_path)
except ImportError:
pass

self._pm = pluggy.PluginManager(PYLS)
self._pm.trace.root.setwriter(log.debug)
Expand Down

0 comments on commit f83f6b5

Please sign in to comment.