Skip to content

Instantly share code, notes, and snippets.

@stlehmann
Last active April 30, 2018 08:51
Show Gist options
  • Save stlehmann/c638748d4ec6e784f7121ef0a9582b56 to your computer and use it in GitHub Desktop.
Save stlehmann/c638748d4ec6e784f7121ef0a9582b56 to your computer and use it in GitHub Desktop.
Script for linting a Python project
import click
import subprocess
click.echo('\n--- Running Mypy ---')
res = subprocess.call(['mypy', '.'])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running Flake8 ---')
res = subprocess.call(['flake8'])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running pydocstyle ---')
res = subprocess.call(['pydocstyle'])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running Pytest ---')
res = subprocess.call(['pytest'])
if res == 0:
click.echo(click.style('OK', fg='green'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment