Commit 54bb2e18 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added pycodestyle conformance

parent 1aba7fde
Pipeline #129 passed with stages
in 11 seconds
import glob
import unittest
import pycodestyle
class TestCodeFormat(unittest.TestCase):
def test_codestyle_conformance(self):
"""Test that we conform to PEP-8."""
style = pycodestyle.StyleGuide(
quiet=True, ignore=["E121", "E123", "E126", "E226", "E24", "E704", "W503", "W504", "E501"])
result = style.check_files(glob.glob("./**/*.py"))
print("================ pycodestyle statistics ================")
if result.total_errors == 0:
print("Your code style is GREAT!")
else:
for line in result.get_statistics():
print(line)
print("*** Please use the command below to check code yourself!!! ***")
print("pycodestyle ./**/*.py --ignore=E121,E123,E126,E226,E24,E704,W503,W504,E501")
print("========================================================")
self.assertEqual(result.total_errors, 0, "Found code style errors (and warnings).")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment