本文整理汇总了Python中flake8.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python flake8.__version__方法的具体用法?Python flake8.__version__怎么用?Python flake8.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flake8
的用法示例。
在下文中一共展示了flake8.__version__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import flake8 [as 别名]
# 或者: from flake8 import __version__ [as 别名]
def run():
"""
Runs flake8 lint
:return:
A bool - if flake8 did not find any errors
"""
print('Running flake8 %s' % flake8.__version__)
flake8_style = get_style_guide(config_file=os.path.join(package_root, 'tox.ini'))
paths = []
for _dir in [package_name, 'dev', 'tests']:
for root, _, filenames in os.walk(_dir):
for filename in filenames:
if not filename.endswith('.py'):
continue
paths.append(os.path.join(root, filename))
report = flake8_style.check_files(paths)
success = report.total_errors == 0
if success:
print('OK')
return success
示例2: version_command
# 需要导入模块: import flake8 [as 别名]
# 或者: from flake8 import __version__ [as 别名]
def version_command(argv) -> CommandResult:
"""Show FlakeHell version.
"""
print('FlakeHell', colored(flakehell_version, 'green'))
print('Flake8 ', colored(flake8_version, 'green'))
print('For plugins versions use', colored('flakehell plugins', 'green'))
return ExitCode.OK, ''