in build/fbcode_builder/getdeps/manifest.py [0:0]
def validate_section(file_name, section, config):
section_def = SCHEMA.get(section)
if not section_def:
for name in ALLOWED_EXPR_SECTIONS:
if section.startswith(name + "."):
# Verify that the conditional parses, but discard it
try:
parse_conditional_section_name(section, name)
except Exception as exc:
raise Exception(
("manifest file %s section '%s' has invalid " "conditional: %s")
% (file_name, section, str(exc))
)
section_def = SCHEMA.get(name)
canonical_section_name = name
break
if not section_def:
raise Exception(
"manifest file %s contains unknown section '%s'" % (file_name, section)
)
else:
canonical_section_name = section
allowed_fields = section_def.get("fields")
if allowed_fields:
validate_allowed_fields(file_name, section, config, allowed_fields)
elif not section_def.get("allow_values", True):
validate_allow_values(file_name, section, config)
return canonical_section_name