зеркало из https://github.com/mozilla/tls-canary.git
Moving from pep8 to pycodestyle
This commit is contained in:
Родитель
998c0c1a41
Коммит
4e36f996be
|
@ -29,7 +29,7 @@ def ignore_file(filename):
|
|||
|
||||
|
||||
def main():
|
||||
modified = re.compile('^[AM]+\s+(?P<name>.*\.py)', re.MULTILINE)
|
||||
modified = re.compile('''^[AM]+\s+(?P<name>.*\.py)''', re.MULTILINE)
|
||||
files = system('git', 'status', '--porcelain').decode("utf-8")
|
||||
files = modified.findall(files)
|
||||
|
||||
|
@ -44,15 +44,15 @@ def main():
|
|||
with open(filename, 'w') as f:
|
||||
system('git', 'show', ':' + name, stdout=f)
|
||||
try:
|
||||
output = system('pep8', '--show-source', '--max-line-length=120', '.', cwd=tempdir)
|
||||
output = system('pycodestyle', '--show-source', '--max-line-length=120', '.', cwd=tempdir).decode("utf-8")
|
||||
except OSError:
|
||||
print("The `pip8` checker is required for commits.")
|
||||
print("The `pycodestyle` checker is required for commits.")
|
||||
print("You probably haven't activated TLS Canary's Python dev environment.")
|
||||
sys.exit(1)
|
||||
|
||||
shutil.rmtree(tempdir)
|
||||
if output:
|
||||
print(output, end=' ')
|
||||
sys.stdout.write(output)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -23,7 +23,7 @@ TESTS_REQUIRE = [
|
|||
DEV_REQUIRES = [
|
||||
'coverage',
|
||||
'nose',
|
||||
'pep8'
|
||||
'pycodestyle'
|
||||
]
|
||||
|
||||
setup(
|
||||
|
|
Загрузка…
Ссылка в новой задаче