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/Tool/tex.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/Tool/tex.py')
-rw-r--r-- | SCons/Tool/tex.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/SCons/Tool/tex.py b/SCons/Tool/tex.py index 0a688f58a..72526c32e 100644 --- a/SCons/Tool/tex.py +++ b/SCons/Tool/tex.py @@ -149,11 +149,11 @@ _null = SCons.Scanner.LaTeX._null modify_env_var = SCons.Scanner.LaTeX.modify_env_var -def check_file_error_message(utility, filename='log'): +def check_file_error_message(utility, filename: str='log') -> None: msg = '%s returned an error, check the %s file\n' % (utility, filename) sys.stdout.write(msg) -def FindFile(name,suffixes,paths,env,requireExt=False): +def FindFile(name,suffixes,paths,env,requireExt: bool=False): if requireExt: name,ext = SCons.Util.splitext(name) # if the user gave an extension use it. @@ -253,7 +253,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None # .aux files already processed by BibTex already_bibtexed = [] - def check_content_hash(filenode, suffix): + def check_content_hash(filenode, suffix) -> bool: """ Routine to update content hash and compare """ @@ -840,7 +840,7 @@ def tex_emitter_core(target, source, env, graphics_extensions): TeXLaTeXAction = None -def generate(env): +def generate(env) -> None: """Add Builders and construction variables for TeX to an Environment.""" global TeXLaTeXAction @@ -859,7 +859,7 @@ def generate(env): bld.add_action('.tex', TeXLaTeXAction) bld.add_emitter('.tex', tex_eps_emitter) -def generate_darwin(env): +def generate_darwin(env) -> None: try: environ = env['ENV'] except KeyError: @@ -874,7 +874,7 @@ def generate_darwin(env): if ospath: env.AppendENVPath('PATH', ospath) -def generate_common(env): +def generate_common(env) -> None: """Add internal Builders and construction variables for LaTeX to an Environment.""" # Add OSX system paths so TeX tools can be found |