THG报告生成器

reportme的Python项目详细描述


报告时间

使用python生成报告

示例

fromreportme.publisherimportReportBufferfromreportme.reporterimportReportfromreportme.reportsimportApproach,Reimplement,StylewithReport(name="Demo",version="0.1.0")asreport:report.description=("Lorem ipsum dolor sit amet, consectetur adipiscing elit.""Cras quis justo risus. Phasellus velit orci, congue sed.""Vivamus sed enim mollis, pulvinar quam quis, blandit ta.")withreport.add_category(name="Pythonicity")aspythonicity:withpythonicity.add_node("PEP8")aspep8:pep8.add_requirement("xxx.py",32,Style.E331("BLA BLA"))pep8.add_requirement("yyy.py",321,Style.W551("TLA TLA"))pep8.add_requirement("zzz.py",543,Style.Z771("TLA TLA"))withpythonicity.add_node("Approachs")asapproachs:approachs.add_requirement("aaa.py",432,Approach.WITH_USE("TLA TLA"))approachs.add_requirement("bbb.py",2432,Approach.STLIB_USE("ZLA ZLA"))withreport.add_category(name="Optimizations")asoptimizations:withoptimizations.add_node("Reimplements")asreimplements:reimplements.add_requirement("zzz.py",322,Reimplement.STDLIB_FUNC("ZZZ, TTT"))reimplements.add_requirement("aaa.py",323,Reimplement.BUILTIN_FUNC("TAD ZZZ"))buf=ReportBuffer()buf.render(report)buf.print()
================================================================================================================================================================
                                                                         Demo (v0.1.0)

Date: 2019-08-02 14:50:51.417556
Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.Cras quis justo risus. Phasellus velit orci, congue sed.Vivamus sed enim mollis, pulvinar
quam quis, blandit ta.

                                                                          Pythonicity

Segment 0: PEP8

|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| file                                     | line       | report                                                                                               |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| xxx.py                                   | 32         | {'_type': 'Style', 'requirement': 'E331', 'message': 'BLA BLA'}                                      |
| yyy.py                                   | 321        | {'_type': 'Style', 'requirement': 'W551', 'message': 'TLA TLA'}                                      |
| zzz.py                                   | 543        | {'_type': 'Style', 'requirement': 'Z771', 'message': 'TLA TLA'}                                      |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|

Segment 1: Approachs

|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| file                                     | line       | report                                                                                               |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| aaa.py                                   | 432        | {'_type': 'Approach', 'requirement': 'WITH_USE', 'message': 'TLA TLA'}                               |
| bbb.py                                   | 2432       | {'_type': 'Approach', 'requirement': 'STLIB_USE', 'message': 'ZLA ZLA'}                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|



                                                                         Optimizations

Segment 0: Reimplements

|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| file                                     | line       | report                                                                                               |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| zzz.py                                   | 322        | {'_type': 'Reimplement', 'requirement': 'STDLIB_FUNC', 'message': 'ZZZ, TTT'}                        |
| aaa.py                                   | 323        | {'_type': 'Reimplement', 'requirement': 'BUILTIN_FUNC', 'message': 'TAD ZZZ'}                        |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|


================================================================================================================================================================

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java能否使用OpenJPA将一个实体持久化到多个持久化单元?   java如何访问当前按下的键   java singleton是否意味着哈希代码总是返回相同的值?   inputstream无法在Java中同时使用STDIN和STDERR读取程序输出   java运行时有多贵。getRuntime()与获取内存度量相结合   java AndroidStudio ListView适配器更新   java小程序请求未扩展实时会话   java是设置布尔值所必需的关键部分?   java比较两个字符串,并突出显示发现的不匹配项   java带抽屉布局,无论哪个屏幕处于活动状态,如何在按下后退键时关闭应用程序?   爪哇:颜色有什么区别。黑色和彩色。黑色   Velocity模板中子类的java访问方法   java如何快速学习Drools或其他规则引擎   从Java应用程序访问时缓存数据库查询结果   java cassandra nodetool JPLISAgent。c错误   java我正在解析一个没有pubDate的RSS提要,有没有其他方法可以确定一个项目是何时发布的?