本文整理匯總了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, ''