aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-08 19:24:32 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-24 02:07:02 -0400
commit71a5db0a031e74ac975e4d310656380ff9312951 (patch)
treee1c47d466df5a95579740104e9003a7b0695bebb /mesonbuild/modules
parent9c7868e343ece2cbb5cbab9c27d7e54886b89fac (diff)
downloadmeson-71a5db0a031e74ac975e4d310656380ff9312951.zip
meson-71a5db0a031e74ac975e4d310656380ff9312951.tar.gz
meson-71a5db0a031e74ac975e4d310656380ff9312951.tar.bz2
dub module: use typed_pos_args to check positional arguments
We cannot use typed_kwargs though, because we allow fully arbitrary kwargs and add them as keys in the generated dub file.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/dlang.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/modules/dlang.py b/mesonbuild/modules/dlang.py
index 558ca81..d9255d9 100644
--- a/mesonbuild/modules/dlang.py
+++ b/mesonbuild/modules/dlang.py
@@ -21,7 +21,7 @@ import os
from . import ExtensionModule
from .. import dependencies
from .. import mlog
-from ..interpreterbase import FeatureNew
+from ..interpreterbase import FeatureNew, typed_pos_args
from ..mesonlib import Popen_safe, MesonException
class DlangModule(ExtensionModule):
@@ -52,13 +52,11 @@ class DlangModule(ExtensionModule):
if not self.dubbin:
raise MesonException('DUB not found.')
+ @typed_pos_args('dlang.generate_dub_file', str, str)
def generate_dub_file(self, state, args, kwargs):
if not DlangModule.init_dub:
self._init_dub(state)
- if len(args) < 2:
- raise MesonException('Missing arguments')
-
config = {
'name': args[0]
}