Skip to content

Commit e9d6cdf

Browse files
committed
Linting.
1 parent 38def87 commit e9d6cdf

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

__pkginfo__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@
2727
"""
2828

2929
__version__ = "2.6.1"
30-
3130
repo_root = pathlib.Path(__file__).parent
3231
install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')
3332
extras_require = {
3433
"dates": ["pytz>=2019.1"],
3534
"testing": ["pytest>=6.2.0", "pytest-regressions>=2.0.2"],
36-
"all": ["pytest-regressions>=2.0.2", "pytest>=6.2.0", "pytz>=2019.1"]
35+
"all": ["pytest>=6.2.0", "pytest-regressions>=2.0.2", "pytz>=2019.1"]
3736
}

domdf_python_tools/secrets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class Secret(str):
5151
.. versionadded:: 0.4.6
5252
"""
5353

54+
__slots__ = ("value", )
55+
5456
value: str #: The actual value of the secret.
5557

5658
def __new__(cls, value) -> "Secret": # noqa D102

domdf_python_tools/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ def convert_indents(text: str, tab_width: int = 4, from_: str = '\t', to: str =
289289

290290
class _Etcetera(str):
291291

292+
__slots__ = ()
293+
292294
def __new__(cls):
293295
return str.__new__(cls, "...")
294296

tests/seq_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def itermulti(seqn):
180180

181181

182182
class LyingTuple(tuple):
183+
__slots__ = ()
183184

184185
def __iter__(self):
185186
yield 1

tests/test_dir_comparator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def comparator_tmpdir(tmp_pathplus):
3434

3535
data.caseinsensitive = os.path.normcase('A') == os.path.normcase('a')
3636

37-
for dir in (data.dir, data.dir_same, data.dir_diff, data.dir_ignored):
37+
for dir in (data.dir, data.dir_same, data.dir_diff, data.dir_ignored): # noqa: A001
3838
shutil.rmtree(dir, True)
3939
os.mkdir(dir)
4040
subdir_path = os.path.join(dir, "subdir")
@@ -188,7 +188,9 @@ def test_dircmp(self, comparator_tmpdir):
188188
self._assert_report(d.report, expected_report)
189189

190190
def test_dircmp_subdirs_type(self, comparator_tmpdir):
191-
"Check that dircmp.subdirs respects subclassing."
191+
"""
192+
Check that dircmp.subdirs respects subclassing.
193+
"""
192194

193195
class MyDirCmp(DirComparator):
194196
pass

tests/test_pretty_print.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@ def __repr__(self):
4343

4444

4545
class tuple2(tuple):
46-
pass
46+
__slots__ = ()
4747

4848

4949
class tuple3(tuple):
50+
__slots__ = ()
5051

5152
def __repr__(self):
5253
return tuple.__repr__(self)
5354

5455

5556
class tuple_custom_repr(tuple):
57+
__slots__ = ()
5658

5759
def __repr__(self):
5860
return '*' * len(tuple.__repr__(self))

tests/test_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __fspath__(self):
7373

7474

7575
class MyStr(str):
76-
pass
76+
__slots__ = ()
7777

7878

7979
class MyPath(type(pathlib.Path())): # type: ignore

0 commit comments

Comments
 (0)