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).
pull/5450/head
Daniel Mensinger 6 years ago committed by Jussi Pakkanen
parent 5465fc5e28
commit 94c6da33a7
  1. 4
      mesonbuild/rewriter.py
  2. 2
      test cases/rewrite/3 kwargs/delete.json

@ -447,7 +447,7 @@ class Rewriter:
# First, remove the old values # First, remove the old values
kwargs_cmd = { kwargs_cmd = {
'function': 'project', 'function': 'project',
'id': "", 'id': "/",
'operation': 'remove_regex', 'operation': 'remove_regex',
'kwargs': { 'kwargs': {
'default_options': ['{}=.*'.format(x) for x in cmd['options'].keys()] 'default_options': ['{}=.*'.format(x) for x in cmd['options'].keys()]
@ -502,7 +502,7 @@ class Rewriter:
if cmd['function'] == 'project': if cmd['function'] == 'project':
if cmd['id'] != '/': if cmd['id'] != '/':
mlog.error('The ID for the function type project must be "/"', *self.on_error()) mlog.error('The ID for the function type project must be "/"', *self.on_error())
self.handle_error() return self.handle_error()
node = self.interpreter.project_node node = self.interpreter.project_node
arg_node = node.args arg_node = node.args
elif cmd['function'] == 'target': elif cmd['function'] == 'target':

@ -2,7 +2,7 @@
{ {
"type": "kwargs", "type": "kwargs",
"function": "project", "function": "project",
"id": "", "id": "/",
"operation": "delete", "operation": "delete",
"kwargs": { "kwargs": {
"version": null "version": null

Loading…
Cancel
Save