コード例 #1
0
ファイル: clientlib.py プロジェクト: 5nilha/Text_summary
        cfgv.NotIn(LOCAL, META),
    ),
    cfgv.ConditionalRecurse(
        'hooks',
        cfgv.Array(MANIFEST_HOOK_DICT),
        'repo',
        LOCAL,
    ),
    cfgv.ConditionalRecurse(
        'hooks',
        cfgv.Array(META_HOOK_DICT),
        'repo',
        META,
    ),
    MigrateShaToRev(),
    cfgv.WarnAdditionalKeys(('repo', 'rev', 'hooks'), warn_unknown_keys_repo),
)
DEFAULT_LANGUAGE_VERSION = cfgv.Map(
    'DefaultLanguageVersion', None, cfgv.NoAdditionalKeys(all_languages),
    *[cfgv.Optional(x, cfgv.check_string, C.DEFAULT) for x in all_languages])
CONFIG_SCHEMA = cfgv.Map(
    'Config',
    None,
    cfgv.RequiredRecurse('repos', cfgv.Array(CONFIG_REPO_DICT)),
    cfgv.OptionalRecurse(
        'default_language_version',
        DEFAULT_LANGUAGE_VERSION,
        {},
    ),
    cfgv.Optional(
        'default_stages',
コード例 #2
0
        cfgv.OptionalNoDefault(item.key, item.check_fn)
        for item in MANIFEST_HOOK_DICT.items
        if item.key != "id"
    ),
)
CONFIG_REPO_DICT = cfgv.Map(
    "Repository",
    "repo",
    cfgv.Required("repo", cfgv.check_string),
    cfgv.ConditionalRecurse(
        "hooks", cfgv.Array(CONFIG_HOOK_DICT), "repo", cfgv.NotIn(LOCAL, META),
    ),
    cfgv.ConditionalRecurse("hooks", cfgv.Array(MANIFEST_HOOK_DICT), "repo", LOCAL,),
    cfgv.ConditionalRecurse("hooks", cfgv.Array(META_HOOK_DICT), "repo", META,),
    MigrateShaToRev(),
    cfgv.WarnAdditionalKeys(("repo", "rev", "hooks"), warn_unknown_keys_repo),
)
DEFAULT_LANGUAGE_VERSION = cfgv.Map(
    "DefaultLanguageVersion",
    None,
    cfgv.NoAdditionalKeys(all_languages),
    *(cfgv.Optional(x, cfgv.check_string, C.DEFAULT) for x in all_languages),
)
CONFIG_SCHEMA = cfgv.Map(
    "Config",
    None,
    cfgv.RequiredRecurse("repos", cfgv.Array(CONFIG_REPO_DICT)),
    cfgv.OptionalRecurse("default_language_version", DEFAULT_LANGUAGE_VERSION, {},),
    cfgv.Optional(
        "default_stages", cfgv.check_array(cfgv.check_one_of(C.STAGES)), C.STAGES,
    ),