【文件属性】:
文件名称:no-string-hints:替换字符串文字类型提示
文件大小:10KB
文件格式:ZIP
更新时间:2021-02-09 01:21:57
pre-commit typing mypy static-typing Python
无字符串提示
一个预提交钩子,用于从参数,返回值和类变量类型注释中自动删除字符串文字作为类型提示。
安装
pip install no_string_hints
作为预提交挂钩
有关说明,请参阅
样本.pre-commit-config.yaml :
- repo : https://github.com/MarcoGorelli/no-string-hints
rev : v0.1.7
hooks :
- id : no-string-hints
命令行示例
$ cat myfile.py
myvar: 'str'
$ no_string_hints myfile.py
$ cat myfile.py
myvar: str
也可以看看
查看 ,我在编写本文时从中学到了很多。
【文件预览】:
no-string-hints-main
----requirements-dev.txt(46B)
----.coveragerc(148B)
----.pre-commit-hooks.yaml(279B)
----.github()
--------workflows()
----tests()
--------data()
--------__init__.py(0B)
--------main_test.py(2KB)
----tox.ini(233B)
----LICENSE(1KB)
----setup.cfg(1KB)
----setup.py(37B)
----.gitignore(64B)
----no_string_hints.py(4KB)
----README.md(1KB)
----.pre-commit-config.yaml(1KB)