MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / _check_config_info

Method _check_config_info

client/node/quicktask/quickrunner.py:162–177  ·  view source on GitHub ↗

验证用户输入的配置信息是否符合要求 :return: 不符合要求,直接抛异常

(self)

Source from the content-addressed store, hash-verified

160 raise NodeError(code=errcode.E_NODE_TASK_SCM_FAILED, msg="不支持的scm类型: %s!" % self._scm_type)
161
162 def _check_config_info(self):
163 """
164 验证用户输入的配置信息是否符合要求
165 :return: 不符合要求,直接抛异常
166 """
167 if not self._source_dir:
168 raise NodeError(code=errcode.E_NODE_TASK_CONFIG, msg="缺少-s参数,未输入本地代码目录!")
169
170 # 有source_dir时,校验 source_dir
171 if self._source_dir:
172 # 验证本地代码目录是否存在
173 self._source_dir = PathMgr().format_path(self._source_dir)
174 # 兼容软链接的情况,如果是软链接,转换成所指向的真实代码目录
175 self._source_dir = os.path.realpath(self._source_dir)
176 if not os.path.exists(self._source_dir):
177 raise NodeError(code=errcode.E_NODE_TASK_CONFIG, msg="代码目录(%s)不存在" % self._source_dir)
178
179 def _check_no_language_exit(self):
180 """

Callers 1

runMethod · 0.95

Calls 1

NodeErrorClass · 0.90

Tested by

no test coverage detected