diff options
author | Mats Wichmann <mats@linux.com> | 2023-05-01 11:54:48 -0600 |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2023-05-01 12:06:45 -0600 |
commit | 1a103470a13a83590b3fc06e8779494e2b99751d (patch) | |
tree | ab4b5fcdbc2504ff1436387dbe82db2dcedff22b /SCons/Scanner/DirTests.py | |
parent | 0ef81fc03600cd275a8e6733aeca26e0db268dad (diff) | |
download | scons-git-1a103470a13a83590b3fc06e8779494e2b99751d.tar.gz |
Add some cheap return and parameter annotations
Use: https://github.com/JelleZijlstra/autotyping
to add "safe" return annotations.
Where a parameter has a default value that is an obvious scalar type
(bool, int, str, etc.) add those annotations as well.
Also fixed two small bugs that popped up when sanity-checking with
mypy. One in FortranCommon, where a return had been previously
annotated to be a tuple of Action, which should be ActionBase -
Action is the factory function, not the base class. The other was
a typo in the error raised in _add_cppdefines - the message was
formatted with the value of "define" which should have been "defines".
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Scanner/DirTests.py')
-rw-r--r-- | SCons/Scanner/DirTests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/SCons/Scanner/DirTests.py b/SCons/Scanner/DirTests.py index 1c46c6c3f..32355f352 100644 --- a/SCons/Scanner/DirTests.py +++ b/SCons/Scanner/DirTests.py @@ -41,7 +41,7 @@ from SCons.SConsign import current_sconsign_filename # return self.fs.Entry(name) class DummyEnvironment: - def __init__(self, root): + def __init__(self, root) -> None: self.fs = SCons.Node.FS.FS(root) def Dir(self, name): return self.fs.Dir(name) @@ -53,7 +53,7 @@ class DummyEnvironment: return factory or self.fs.Entry class DirScannerTestBase(unittest.TestCase): - def setUp(self): + def setUp(self) -> None: self.test = TestCmd.TestCmd(workdir = '') self.test.subdir('dir', ['dir', 'sub']) @@ -79,7 +79,7 @@ class DirScannerTestBase(unittest.TestCase): self.test.write(['dir', 'sub', '{}.pag'.format(sconsign)], "dir/{}.pag\n".format(sconsign)) class DirScannerTestCase(DirScannerTestBase): - def runTest(self): + def runTest(self) -> None: env = DummyEnvironment(self.test.workpath()) s = SCons.Scanner.Dir.DirScanner() @@ -102,7 +102,7 @@ class DirScannerTestCase(DirScannerTestBase): assert sss == expect, "Found {}, expected {}".format(sss, expect) class DirEntryScannerTestCase(DirScannerTestBase): - def runTest(self): + def runTest(self) -> None: env = DummyEnvironment(self.test.workpath()) s = SCons.Scanner.Dir.DirEntryScanner() |