Add pycodestyle and flake8 tests to Travis

Refactor style issues for pycodestyle tests to pass
This commit is contained in:
David-Wobrock committed 2017-11-22 17:10:01 +01:00
1 parent 174bb19319
commit 844fbc3c1a
3 files changed
+9 -3

No files matched your search

+2
View File
@@ -5,6 +5,8 @@ python:
- "3.5" - "3.5"
- "3.6" - "3.6"
script: script:
- pycodestyle django_migration_linter
- flake8 django_migration_linter
- py.test - py.test
install: install:
- pip install -e ".[test]" - pip install -e ".[test]"
+4 -2
View File
@@ -109,7 +109,8 @@ class MigrationLinter:
diff_process.wait() diff_process.wait()
if diff_process.returncode != 0: if diff_process.returncode != 0:
output = [] output = []
for line in map(clean_bytes_to_str, diff_process.stderr.readlines()): for line in map(
clean_bytes_to_str, diff_process.stderr.readlines()):
output.append(line) output.append(line)
log.info("Error while git diff command:\n{}".format( log.info("Error while git diff command:\n{}".format(
"".join(output))) "".join(output)))
@@ -187,7 +188,8 @@ class MigrationLinter:
sqlmigrate_process = Popen( sqlmigrate_process = Popen(
git_diff_command, shell=True, stdout=PIPE, stderr=PIPE) git_diff_command, shell=True, stdout=PIPE, stderr=PIPE)
sql_statements = [] sql_statements = []
for line in map(clean_bytes_to_str, sqlmigrate_process.stdout.readlines()): for line in map(
clean_bytes_to_str, sqlmigrate_process.stdout.readlines()):
if not line.startswith('--'): # Ignore comments if not line.startswith('--'): # Ignore comments
sql_statements.append(line) sql_statements.append(line)
sqlmigrate_process.wait() sqlmigrate_process.wait()
+3 -1
View File
@@ -28,7 +28,9 @@ install_requirements = [
test_requirements = [ test_requirements = [
'pytest', 'pytest',
'django', 'django',
'django-fake-database-backends' 'django-fake-database-backends',
'pycodestyle',
'flake8'
] ]
setup( setup(