Skip to content

Commit f2ece4e

Browse files
committed
Linting.
1 parent d3bb707 commit f2ece4e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

notebook2script/pointless.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
import warnings
146146

147147
# 3rd party
148+
from domdf_python_tools.paths import PathPlus
148149
from pylint import reporters # type: ignore
149150
from pylint.lint.pylinter import PyLinter # type: ignore
150151
from pylint.utils import utils # type: ignore
@@ -181,8 +182,8 @@ def process_file(self, filename): # noqa: D102
181182
with fix_import_path([filename]):
182183
self._check_files(self.get_ast, self._iterate_file_descrs([filename]))
183184

184-
filename = pathlib.Path(filename)
185-
file_lines = filename.read_text().splitlines()
185+
filename = PathPlus(filename)
186+
file_lines = filename.read_lines()
186187

187188
for node in self.statements:
188189

@@ -205,7 +206,7 @@ def process_file(self, filename): # noqa: D102
205206
file_lines.append('')
206207

207208
# print("\n".join(file_lines))
208-
filename.write_text('\n'.join(file_lines))
209+
filename.write_lines(file_lines)
209210

210211
def add_message(self, msgid, line=None, node=None, args=None, confidence=None, col_offset=None):
211212
"""Adds a message given by ID or name.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
astroid<=2.5,>=2.4.0
22
click>=7.1.2
33
consolekit>=0.6.0
4-
domdf-python-tools>=1.0.0
4+
domdf-python-tools>=2.8.1
55
ipython>=7.14.0
66
isort>=5.5.2
77
nbconvert>=5.6.1
88
pre-commit-hooks>=3.3.0
99
pylint>=2.5.2
10-
yapf-isort>=0.3.3
10+
yapf-isort>=0.5.5

0 commit comments

Comments
 (0)