Fix ci parameter checking script by fufu0615 · Pull Request #6864 · PaddlePaddle/docs (original) (raw)
尝试修复ci参数检查
为方便描述,以下称图中红框部分为文档的标题 API 字符串,蓝框部分为文档的参数板块:
本pr的大致贡献如下:
完善提取intitle参数的代码
之前的只能提取文档标题 API 字符串 .. py:function:: func() 的 args 参数,完善后可以提取 API 中所有类型的参数;
添加更详细的文档参数检查日志
添加了更详细的日志来帮助排查文档的格式问题:
- Something wrong with the format of params list in description, check it please.
表示文档的参数板块存在格式问题 - Params section in description is empty, check it please.
表示文档的参数板块内容为空 - The number of params in title does not match the params in description: {len(params_intitle)} != {len(items)}.
表示文档标题 API 字符串的参数数量len(params_intitle)与参数板块中的参数数量len(items)不符 - the following param in title does not match the param in description: {pname_intitle} != {pname_indesc}
表示文档标题 API 字符串中的参数pname_intitle与参数板块中对应位置参数pname_indesc的名称不符 - param name '{pname_intitle}' not matched in description line{i+1}, check it please.
表示文档标题 API 字符串中的参数pname_intitle在参数板块中对应位置(第i+1行处)没有找到相应的描述 - params section not found in description, check it please.
表示文档中没有参数板块
修复现有问题文档
修正了之前发现的存在格式问题的文档,具体列表见 #6839
统一用 Inplace 文档链接 Outplace 文档
将以下文档改为将 Inplace 版本的 API 文档的参数介绍链接向 Outplace 版本的 API 文档,与其他文档统一:
"api/paddle/index_fill_cn.rst", "api/paddle/index_fill__cn.rst", "api/paddle/index_put_cn.rst", "api/paddle/index_fill__cn.rst",
总览和 Inplace 文档跳过参数检查
在参数检查时,将总览文档(api/paddle/Overview_cn.rst)和所有 Inplace 版本的 API 文档自动跳过
