跳转到主要内容

以新的方式编写python代码文档

项目描述

存档:以新的方式编写python代码文档

image PyPI version Code style: black Python 3.6+ supported Documentation style: archives

存档 是一种新的python代码文档风格,同时也是文档本身的lint工具。它可以帮助您确保您的类和函数中的docstrings保持最新,并且能够充分解释其目的、参数和返回值。

Perhaps the archives are incomplete

功能

  • docstrings的lint工具(正在开发中,但可用!)
  • (即将推出)文档生成器

使用方法

安装

pip install archives

运行lint工具

# run archives (on itself!)
archives archives/

# archives.py:846:0: F104 function 'path_empty' missing @ret tag
#
# Impossible! Perhaps your archives are incomplete?
# 1 issues found.

# list tags!
archives --list-tag

# @arg    describe an argument of a function
# @author denote the author of a module/class/function
# @cc     denote the complexity of a function
# @desc   describe a module/class/function
# @link   add a link to the generated documentation
# @nodoc  disable this module/class/function in the documentation
# @nolint disable archives linting in this module/class/function
# @note   add a note to a module/class/function
# @ret    describe the return value of a function
# @todo   tag something as a todo
# @warn   add a warning to a module/class/function

# list rules!
archives --list-rules


# disable rules!
archives --disable M100 .

# different formats for output! defaults to flake8
archives --format pylint archives.py

测试

可以使用tox运行测试!

# run tests
tox

# only one version of python
tox -e py36

待办事项

  • 更多规则
  • 更好的多检查规则系统
  • 更多输出格式
  • 在描述中进行潜在的拼写检查?
  • 文档生成器
  • 测试

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

archives-0.12.tar.gz (14.3 kB 查看哈希值)

上传于

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面