MCPcopy Index your code
hub / github.com/nodejs/node / CmdValidate

Method CmdValidate

deps/v8/tools/mb/mb.py:429–488  ·  view source on GitHub ↗
(self, print_ok=True)

Source from the content-addressed store, hash-verified

427 return 0
428
429 def CmdValidate(self, print_ok=True):
430 errs = []
431
432 # Read the file to make sure it parses.
433 self.ReadConfigFile()
434
435 # Build a list of all of the configs referenced by builders.
436 all_configs = {}
437 for builder_group in self.builder_groups:
438 for config in self.builder_groups[builder_group].values():
439 if isinstance(config, dict):
440 for c in config.values():
441 all_configs[c] = builder_group
442 else:
443 all_configs[config] = builder_group
444
445 # Check that every referenced args file or config actually exists.
446 for config, loc in all_configs.items():
447 if config.startswith('//'):
448 if not self.Exists(self.ToAbsPath(config)):
449 errs.append('Unknown args file "%s" referenced from "%s".' %
450 (config, loc))
451 elif not config in self.configs:
452 errs.append('Unknown config "%s" referenced from "%s".' %
453 (config, loc))
454
455 # Check that every actual config is actually referenced.
456 for config in self.configs:
457 if not config in all_configs:
458 errs.append('Unused config "%s".' % config)
459
460 # Figure out the whole list of mixins, and check that every mixin
461 # listed by a config or another mixin actually exists.
462 referenced_mixins = set()
463 for config, mixins in self.configs.items():
464 for mixin in mixins:
465 if not mixin in self.mixins:
466 errs.append('Unknown mixin "%s" referenced by config "%s".' %
467 (mixin, config))
468 referenced_mixins.add(mixin)
469
470 for mixin in self.mixins:
471 for sub_mixin in self.mixins[mixin].get('mixins', []):
472 if not sub_mixin in self.mixins:
473 errs.append('Unknown mixin "%s" referenced by mixin "%s".' %
474 (sub_mixin, mixin))
475 referenced_mixins.add(sub_mixin)
476
477 # Check that every mixin defined is actually referenced somewhere.
478 for mixin in self.mixins:
479 if not mixin in referenced_mixins:
480 errs.append('Unreferenced mixin "%s".' % mixin)
481
482 if errs:
483 raise MBErr(('mb config file %s has problems:' % self.args.config_file) +
484 '\n ' + '\n '.join(errs))
485
486 if print_ok:

Callers

nothing calls this directly

Calls 12

ReadConfigFileMethod · 0.95
ExistsMethod · 0.95
ToAbsPathMethod · 0.95
PrintMethod · 0.95
MBErrClass · 0.85
addMethod · 0.65
getMethod · 0.65
setFunction · 0.50
valuesMethod · 0.45
itemsMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected