Skip to content

Instantly share code, notes, and snippets.

@stlehmann
Last active September 23, 2018 08:55
Show Gist options
  • Save stlehmann/ced804f4a0d6ef3575e52543d5e942f7 to your computer and use it in GitHub Desktop.
Save stlehmann/ced804f4a0d6ef3575e52543d5e942f7 to your computer and use it in GitHub Desktop.
Script for linting a Python project
"""
Script for linting the current project.
:author: Stefan Lehmann <stlm@posteo.de>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on 2018-06-28 15:10:47
:last modified by: Stefan Lehmann
:last modified time: 2018-06-28 15:12:56
"""
import click
import subprocess
PACKAGE_NAME = 'app'
click.echo('\n--- Running Mypy ---')
res = subprocess.call(['mypy', PACKAGE_NAME])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running Flake8 ---')
res = subprocess.call(['flake8', PACKAGE_NAME])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running pydocstyle ---')
res = subprocess.call(['pydocstyle', PACKAGE_NAME])
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