Skip to content

Commit 94c6da3

Browse files
mensindajpakkane
authored andcommitted
rewriter: Fix that default_options would not set the correct id
Currently default_options uses "" for the kwarks id, however this is incorect and it must be "/". Additionally, this error won't be ignored in the future with "--skip" (this is why the tests were passing and this wasn't detected earlier).
1 parent 5465fc5 commit 94c6da3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mesonbuild/rewriter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def process_default_options(self, cmd):
447447
# First, remove the old values
448448
kwargs_cmd = {
449449
'function': 'project',
450-
'id': "",
450+
'id': "/",
451451
'operation': 'remove_regex',
452452
'kwargs': {
453453
'default_options': ['{}=.*'.format(x) for x in cmd['options'].keys()]
@@ -502,7 +502,7 @@ def process_kwargs(self, cmd):
502502
if cmd['function'] == 'project':
503503
if cmd['id'] != '/':
504504
mlog.error('The ID for the function type project must be "/"', *self.on_error())
505-
self.handle_error()
505+
return self.handle_error()
506506
node = self.interpreter.project_node
507507
arg_node = node.args
508508
elif cmd['function'] == 'target':

test cases/rewrite/3 kwargs/delete.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"type": "kwargs",
44
"function": "project",
5-
"id": "",
5+
"id": "/",
66
"operation": "delete",
77
"kwargs": {
88
"version": null

0 commit comments

Comments
 (0)