From 1624354f33bf0a33f0e715ba1ca391ae0154ad19 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 12 Jul 2023 15:12:36 -0500 Subject: Use CompileCheckMode enum There were a ton of naked strings with TODOs telling us to use the enum. --- mesonbuild/compilers/vala.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/compilers/vala.py') diff --git a/mesonbuild/compilers/vala.py b/mesonbuild/compilers/vala.py index 40cfc14..e1477b9 100644 --- a/mesonbuild/compilers/vala.py +++ b/mesonbuild/compilers/vala.py @@ -19,7 +19,7 @@ import typing as T from .. import mlog from ..mesonlib import EnvironmentException, version_compare, OptionKey -from .compilers import Compiler, LibType +from .compilers import CompileCheckMode, Compiler, LibType if T.TYPE_CHECKING: from ..envconfig import MachineInfo @@ -100,7 +100,7 @@ class ValaCompiler(Compiler): extra_flags += self.get_compile_only_args() else: extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language) - with self.cached_compile(code, environment.coredata, extra_args=extra_flags, mode='compile') as p: + with self.cached_compile(code, environment.coredata, extra_args=extra_flags, mode=CompileCheckMode.COMPILE) as p: if p.returncode != 0: msg = f'Vala compiler {self.name_string()!r} cannot compile programs' raise EnvironmentException(msg) @@ -122,7 +122,7 @@ class ValaCompiler(Compiler): args += env.coredata.get_external_args(self.for_machine, self.language) vapi_args = ['--pkg', libname] args += vapi_args - with self.cached_compile(code, env.coredata, extra_args=args, mode='compile') as p: + with self.cached_compile(code, env.coredata, extra_args=args, mode=CompileCheckMode.COMPILE) as p: if p.returncode == 0: return vapi_args # Not found? Try to find the vapi file itself. -- cgit v1.1 From 33c8362a1cdd57dd60c7be8fdf3b0566ccdeb3bf Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 12 Jul 2023 17:56:18 -0500 Subject: Match the method signatures of parent classes Names and types of some methods did not match their parent methods. --- mesonbuild/compilers/vala.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/vala.py') diff --git a/mesonbuild/compilers/vala.py b/mesonbuild/compilers/vala.py index e1477b9..c6af04a 100644 --- a/mesonbuild/compilers/vala.py +++ b/mesonbuild/compilers/vala.py @@ -46,7 +46,7 @@ class ValaCompiler(Compiler): def get_debug_args(self, is_debug: bool) -> T.List[str]: return ['--debug'] if is_debug else [] - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, outputname: str) -> T.List[str]: return [] # Because compiles into C. def get_compile_only_args(self) -> T.List[str]: @@ -64,7 +64,7 @@ class ValaCompiler(Compiler): def get_always_args(self) -> T.List[str]: return ['-C'] - def get_warn_args(self, warning_level: str) -> T.List[str]: + def get_warn_args(self, level: str) -> T.List[str]: return [] def get_no_warn_args(self) -> T.List[str]: -- cgit v1.1