def lint(session):
    """Run linters."""
    def run_flake(source):
        return session.run("python", "-m", "flake8", "--count",
                           "--select=E9,F63,F7,F82,E225,E251", "--show-source",
                           "--statistics", source)

    def run_pylint(source):
        return session.run("python", "-m", "pylint", "--rcfile=.pylintrc",
                           source)

    session.install("flake8")
    session.install("pylint")

    for source in ["brepnet"]:
        run_flake(source)
        run_pylint(source)