连续IO检查/测试套件
ciocheck的Python项目详细描述
[![审查员代码质量](https://scrunizer-ci.com/g/continumio/ciocheck/badges/quality-score.png?b=master)](https://scrunizer-ci.com/g/continumio/ciocheck/?分支=主)
[![代码问题](https://www.quantifiedcode.com/api/v1/project/ccc68df612024e7e8fd386ffe2252a95/badge.svg)(https://www.quantifiedcode.com/app/project/ccc68df612024e7e8fd386ffe2252a95)
?
它利用了python可用的不同linting、格式化和测试工具
包括:
\linters
-[pep8](https://pep8.readthedocs.io/)(代码的样式检查)
-[pydocstyle](https://pydocstyle.readthedocs.io/en/latest/)(文档的样式检查)字符串)
-[flake8](http://flake8.readthedocs.io/en/latest/)(基于[pep8](https://pep8.readthedocs.io/)和[pyflakes](https://github.com/pyflakes/pyflakes))的样式检查
-[pylint](https://pylint.readthedocs.io/)(代码质量检查)
ub.com/hhato/autopep8)(代码格式化程序)
-[yapf](https://github.com/google/yapf)(代码格式化程序)
-[isort](https://github.com/timothycrosley/isort/)(导入语句格式化程序)
-[test-cov](http://pytest-cov.readthedocs.io/en/latest/)(运行代码[cove]rage](http://coverage.readthedocs.io/en/latest)和[pytest](http://pytest.org/latest/)库一起使用
还有一些额外的优点,比如:
-所有工具的单文件配置(仍在消除
冗余)
-自动添加文件夹containing python files
-为python文件自动添加自定义编码和版权头
-仅为暂存/未暂存或提交的diff运行工具(仅支持git)
-为修改的行、修改的文件或所有文件运行工具。
为什么要进行ciocheck?
有许多用于测试代码质量的提交后工具,但ciocheck的思想是在提交推送之前执行检查和自动格式化。
----------------------------------
ciocheck
https://github.com/continuMio/ciocheck
----------
[ciocheck]
inherit配置=.ciocheck
branch=origin/master
diff模式=commited
文件模式=行
检查=pep8,pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,覆盖率,pytest
强制=pep8,pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,覆盖率,pytest
python(pyformat)
标题=-*-编码:utf-8-*-
版权文件='.cionecoding'
add_copyright=true
add_header=true
add_init=true
https://pep8.readthedocs.io/en/release-1.7.x/intro.html配置---————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————----------------------------------
[pydocstyle]
add ignore=d203,
inherit=false
http://flake8.readthedocs.io/en/latest/config.html
--------------------------------
[flake8]
exclude=*/tests/*
ignore=e126,
max line length=79
max complexity=64
\---————————————————————————————————————————————————————————————————————————设置
ty=6,pytest,autopep8,yapf,pylint
行长度=79
节=未来,stdlib,第三方,第一方,本地文件夹--——
[yapf:style]
基于"u style=pep8
列限制=79
注释前的空格=2
——
[autopep8]
exclude=*/tests/*
ignore=e126,
max line length=99
aggressive=0
[coverage:run]
omit=
*/tests/
[coverage:report]
fail_under=0
show_missing=true
skip_covered=true
exclude_行数
必须重新启用标准pragma
pragma:no coverver
忽略本地文件测试
def test()
[coverage:no coverver
;忽略本地文件测试
def test()
":
#-----------------------------------
pytest
http://doc.pytest.org/en/latest/usage.html
-----------------------------------
[pytest]
addopts=-rfew--durations=10
python_functions=test
````
usage
``bash
usage:ciocheck[-h][--disable formatters][--disable linters]
[--disable tests][--file mode{lines,files,all}]
[--diff mode{committed,staged,unstaged}[--branch branch]
[--check{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autoep8,coverage,pytest}[{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}…]
[-强制{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}[{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}…]
[-配置配置文件]
文件夹[文件夹…]
uum分析测试套件。
位置参数:
要分析的文件夹。从repo根目录使用。'
可选参数:
--help,-h显示此帮助消息并退出
--disable formatters,-df跳过所有配置的格式化程序
--disable linter,-dl跳过所有配置的linter
--disable tests,-dt跳过运行测试
--file mode,-fm{lines,files,all}
定义工具是否应在
文件(默认)、修改文件或所有文件的修改行上运行
--diff mode,-dm{committed、staged、unstaged}
定义diff mode。默认模式已提交。
--branch,-b branch定义要与之比较的分支。默认分支是
"origin/master"选择要运行的工具。默认值为"pep8"
--enforce,-e{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}
选择要强制的工具。如果获得
结果,强制工具将失败。默认为"无"。
--config,-cf config_file选择要使用的配置文件。默认值为"无"。
```
仅在"某些模块"中检查导入的格式。
从git repo的根目录使用ciocheck(目前…)。
``bash
$ciocheck some\u模块/
```
[![代码问题](https://www.quantifiedcode.com/api/v1/project/ccc68df612024e7e8fd386ffe2252a95/badge.svg)(https://www.quantifiedcode.com/app/project/ccc68df612024e7e8fd386ffe2252a95)
?
它利用了python可用的不同linting、格式化和测试工具
包括:
\linters
-[pep8](https://pep8.readthedocs.io/)(代码的样式检查)
-[pydocstyle](https://pydocstyle.readthedocs.io/en/latest/)(文档的样式检查)字符串)
-[flake8](http://flake8.readthedocs.io/en/latest/)(基于[pep8](https://pep8.readthedocs.io/)和[pyflakes](https://github.com/pyflakes/pyflakes))的样式检查
-[pylint](https://pylint.readthedocs.io/)(代码质量检查)
ub.com/hhato/autopep8)(代码格式化程序)
-[yapf](https://github.com/google/yapf)(代码格式化程序)
-[isort](https://github.com/timothycrosley/isort/)(导入语句格式化程序)
-[test-cov](http://pytest-cov.readthedocs.io/en/latest/)(运行代码[cove]rage](http://coverage.readthedocs.io/en/latest)和[pytest](http://pytest.org/latest/)库一起使用
还有一些额外的优点,比如:
-所有工具的单文件配置(仍在消除
冗余)
-自动添加文件夹containing python files
-为python文件自动添加自定义编码和版权头
-仅为暂存/未暂存或提交的diff运行工具(仅支持git)
-为修改的行、修改的文件或所有文件运行工具。
为什么要进行ciocheck?
有许多用于测试代码质量的提交后工具,但ciocheck的思想是在提交推送之前执行检查和自动格式化。
----------------------------------
ciocheck
https://github.com/continuMio/ciocheck
----------
[ciocheck]
inherit配置=.ciocheck
branch=origin/master
diff模式=commited
文件模式=行
检查=pep8,pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,覆盖率,pytest
强制=pep8,pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,覆盖率,pytest
python(pyformat)
标题=-*-编码:utf-8-*-
版权文件='.cionecoding'
add_copyright=true
add_header=true
add_init=true
https://pep8.readthedocs.io/en/release-1.7.x/intro.html配置---————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————----------------------------------
[pydocstyle]
add ignore=d203,
inherit=false
http://flake8.readthedocs.io/en/latest/config.html
--------------------------------
[flake8]
exclude=*/tests/*
ignore=e126,
max line length=79
max complexity=64
\---————————————————————————————————————————————————————————————————————————设置
ty=6,pytest,autopep8,yapf,pylint
行长度=79
节=未来,stdlib,第三方,第一方,本地文件夹--——
[yapf:style]
基于"u style=pep8
列限制=79
注释前的空格=2
——
[autopep8]
exclude=*/tests/*
ignore=e126,
max line length=99
aggressive=0
[coverage:run]
omit=
*/tests/
[coverage:report]
fail_under=0
show_missing=true
skip_covered=true
exclude_行数
必须重新启用标准pragma
pragma:no coverver
忽略本地文件测试
def test()
[coverage:no coverver
;忽略本地文件测试
def test()
":
#-----------------------------------
pytest
http://doc.pytest.org/en/latest/usage.html
-----------------------------------
[pytest]
addopts=-rfew--durations=10
python_functions=test
````
usage
``bash
usage:ciocheck[-h][--disable formatters][--disable linters]
[--disable tests][--file mode{lines,files,all}]
[--diff mode{committed,staged,unstaged}[--branch branch]
[--check{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autoep8,coverage,pytest}[{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}…]
[-强制{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}[{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}…]
[-配置配置文件]
文件夹[文件夹…]
uum分析测试套件。
位置参数:
要分析的文件夹。从repo根目录使用。'
可选参数:
--help,-h显示此帮助消息并退出
--disable formatters,-df跳过所有配置的格式化程序
--disable linter,-dl跳过所有配置的linter
--disable tests,-dt跳过运行测试
--file mode,-fm{lines,files,all}
定义工具是否应在
文件(默认)、修改文件或所有文件的修改行上运行
--diff mode,-dm{committed、staged、unstaged}
定义diff mode。默认模式已提交。
--branch,-b branch定义要与之比较的分支。默认分支是
"origin/master"选择要运行的工具。默认值为"pep8"
--enforce,-e{pep8,pydocstyle,flake8,pylint,pyformat,isort,yapf,autopep8,coverage,pytest}
选择要强制的工具。如果获得
结果,强制工具将失败。默认为"无"。
--config,-cf config_file选择要使用的配置文件。默认值为"无"。
```
仅在"某些模块"中检查导入的格式。
从git repo的根目录使用ciocheck(目前…)。
``bash
$ciocheck some\u模块/
```