<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""Command line utility for proselint."""

import click
import os
import imp


def log_error(line, column, error_code, msg):
    """Print a message to the command line."""
    click.echo(str(line) + ":" +
               str(column) + " \t" +
               error_code + ": " +
               msg + " " +
               "http://lifelinter.com/" + error_code)


@click.command()
@click.option('--version/--whatever', default=False)
@click.argument('file', default=False)
def proselint(version, file):
    """Run the linter."""

    if not file:
        raise ValueError("Specify a file to lint using the --file flag.")

    # Extract functions from the checks folder.
    checks = []

    listing = os.listdir(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), "checks"))

    for f in listing:
        if f[-3:] == ".py" and not f == "__init__.py":
            m = imp.load_source("rule", os.path.join("proselint", "checks", f))
            checks.append(getattr(m, 'check'))

    # Return the version number.
    if version:
        print "v0.0.1"

    # Apply all the checks.
    else:
        with open(file, "r") as f:
            text = f.read()
            for check in checks:
                errors = check(text)
                if errors:
                    for error in errors:
                        log_error(*error)
<commit_msg>Change base URL<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""Command line utility for proselint."""

import click
import os
import imp

base_url = "prose.lifelinter.com/"


def log_error(line, column, error_code, msg):
    """Print a message to the command line."""
    click.echo(str(line) + ":" +
               str(column) + " \t" +
               error_code + ": " +
               msg + " " +
               base_url + error_code)


@click.command()
@click.option('--version/--whatever', default=False)
@click.argument('file', default=False)
def proselint(version, file):
    """Run the linter."""

    if not file:
        raise ValueError("Specify a file to lint using the --file flag.")

    # Extract functions from the checks folder.
    checks = []

    listing = os.listdir(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), "checks"))

    for f in listing:
        if f[-3:] == ".py" and not f == "__init__.py":
            m = imp.load_source("rule", os.path.join("proselint", "checks", f))
            checks.append(getattr(m, 'check'))

    # Return the version number.
    if version:
        print "v0.0.1"

    # Apply all the checks.
    else:
        with open(file, "r") as f:
            text = f.read()
            for check in checks:
                errors = check(text)
                if errors:
                    for error in errors:
                        log_error(*error)

{'fraction_non_alphanumeric': 0.14611072179397336, 'fraction_numerical': 0.00350385423966363, 'mean_word_length': 1.955486542443064, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4791380', 'n_tokens_mistral': 889, 'n_tokens_neox': 856, 'n_words': 242}