Skip to content

Instantly share code, notes, and snippets.

@sdhutchins
Created June 8, 2017 23:56
Show Gist options
  • Save sdhutchins/c1870be2c2ccf32e627d229ee373ad26 to your computer and use it in GitHub Desktop.
Save sdhutchins/c1870be2c2ccf32e627d229ee373ad26 to your computer and use it in GitHub Desktop.
Check Code Style
import pycodestyle
import os
def checkstyle(rootpath):
r = rootpath
for root, dirs, files in os.walk(r, topdown=True):
for f in files:
if f.endswith('.py'):
fchecker = pycodestyle.Checker(os.path.join(root, f),
show_source=True)
file_errors = fchecker.check_all()
print("Found %s errors (and warnings)" % file_errors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment