diff options
Diffstat (limited to 'scripts/dev/misc_checks.py')
-rw-r--r-- | scripts/dev/misc_checks.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py index 91baec926..3a93b05e1 100644 --- a/scripts/dev/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -247,7 +247,23 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]: ( re.compile(fr'qtbot\.(?!{qtbot_excludes})[a-z]+[A-Z].*'), "use snake-case instead", - ) + ), + ( + re.compile(r'\.joinpath\('), + "use the / operator for joining paths", + ), + ( + re.compile(r"""pathlib\.Path\(["']~["']\)\.expanduser\(\)"""), + "use pathlib.Path.home() instead", + ), + ( + re.compile(r'pathlib\.Path\(tmp_path\)'), + "tmp_path already is a pathlib.Path", + ), + ( + re.compile(r'pathlib\.Path\(tmpdir\)'), + "use tmp_path instead", + ), ] # Files which should be ignored, e.g. because they come from another |