Skip to content

Commit e8cf8e5

Browse files
authored
Unpin Pylint (#94)
1 parent a838b62 commit e8cf8e5

14 files changed

+28
-27
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ disable =
1616
too-few-public-methods,
1717
too-many-arguments,
1818
too-many-instance-attributes,
19-
import-error
19+
import-error,
20+
consider-using-f-string,
2021

2122
[REPORTS]
2223

pylsp/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _configure_logger(verbose=0, log_config=None, log_file=None):
9292
root_logger = logging.root
9393

9494
if log_config:
95-
with open(log_config, 'r') as f:
95+
with open(log_config, 'r', encoding='utf-8') as f:
9696
logging.config.dictConfig(json.load(f))
9797
else:
9898
formatter = logging.Formatter(LOG_FORMAT)

pylsp/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def format_docstring(contents):
144144
Until we can find a fast enough way of discovering and parsing each format,
145145
we can do a little better by at least preserving indentation.
146146
"""
147-
contents = contents.replace('\t', u'\u00A0' * 4)
148-
contents = contents.replace(' ', u'\u00A0' * 2)
147+
contents = contents.replace('\t', '\u00A0' * 4)
148+
contents = contents.replace(' ', '\u00A0' * 2)
149149
return contents
150150

151151

pylsp/plugins/flake8_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run_flake8(flake8_executable, args, document):
7979
try:
8080
cmd = [flake8_executable]
8181
cmd.extend(args)
82-
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
82+
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
8383
except IOError:
8484
log.debug("Can't execute %s. Trying with 'python -m flake8'", flake8_executable)
8585
cmd = ['python', '-m', 'flake8']

pylsp/plugins/pylint_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _run_pylint_stdio(pylint_executable, document, flags):
236236
cmd = [pylint_executable]
237237
cmd.extend(flags)
238238
cmd.extend(['--from-stdin', document.path])
239-
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
239+
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
240240
except IOError:
241241
log.debug("Can't execute %s. Trying with 'python -m pylint'", pylint_executable)
242242
cmd = ['python', '-m', 'pylint']

pylsp/workspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def root_uri(self):
7676
return self._root_uri
7777

7878
def is_local(self):
79-
return (self._root_uri_scheme == '' or self._root_uri_scheme == 'file') and os.path.exists(self._root_path)
79+
return (self._root_uri_scheme in ['', 'file']) and os.path.exists(self._root_path)
8080

8181
def get_document(self, doc_uri):
8282
"""Return a managed document if-present, else create one pointing at disk.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_version(module='pylsp'):
5252
'pycodestyle>=2.7.0',
5353
'pydocstyle>=2.0.0',
5454
'pyflakes>=2.3.0,<2.4.0',
55-
'pylint>=2.5.0,<2.10.0',
55+
'pylint>=2.5.0',
5656
'rope>=0.10.5',
5757
'yapf',
5858
],
@@ -62,10 +62,10 @@ def get_version(module='pylsp'):
6262
'pycodestyle': ['pycodestyle>=2.7.0'],
6363
'pydocstyle': ['pydocstyle>=2.0.0'],
6464
'pyflakes': ['pyflakes>=2.3.0,<2.4.0'],
65-
'pylint': ['pylint>=2.5.0,<2.10.0'],
65+
'pylint': ['pylint>=2.5.0'],
6666
'rope': ['rope>0.10.5'],
6767
'yapf': ['yapf'],
68-
'test': ['pylint>=2.5.0,<2.10.0', 'pytest', 'pytest-cov', 'coverage',
68+
'test': ['pylint>=2.5.0', 'pytest', 'pytest-cov', 'coverage',
6969
'numpy', 'pandas', 'matplotlib', 'pyqt5', 'flaky'],
7070
},
7171
entry_points={

test/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def temp_workspace_factory(workspace): # pylint: disable=redefined-outer-name
101101
def fn(files):
102102
def create_file(name, content):
103103
fn = os.path.join(workspace.root_path, name)
104-
with open(fn, 'w') as f:
104+
with open(fn, 'w', encoding='utf-8') as f:
105105
f.write(content)
106106
workspace.put_document(uris.from_fs_path(fn), content)
107107

test/plugins/test_flake8_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_flake8_cfg_settings(workspace, config_str):
9393
This function creates a ``setup.cfg``; you'll have to delete it yourself.
9494
"""
9595

96-
with open(os.path.join(workspace.root_path, "setup.cfg"), "w+") as f:
96+
with open(os.path.join(workspace.root_path, "setup.cfg"), "w+", encoding='utf-8') as f:
9797
f.write(config_str)
9898

9999
workspace.update_config({"pylsp": {"configurationSources": ["flake8"]}})

test/plugins/test_pycodestyle_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_pycodestyle_config(workspace):
9191

9292
for conf_file, (content, working) in list(content.items()):
9393
# Now we'll add config file to ignore it
94-
with open(os.path.join(workspace.root_path, conf_file), 'w+') as f:
94+
with open(os.path.join(workspace.root_path, conf_file), 'w+', encoding='utf-8') as f:
9595
f.write(content)
9696
workspace._config.settings.cache_clear()
9797

0 commit comments

Comments
 (0)