Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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