<commit_before>extern crate crypto;
extern crate regex;
extern crate rustc_serialize;

use crypto::md5::Md5;
use crypto::digest::Digest;

use rustc_serialize::{json, Decodable, Encodable};

use std::collections::HashMap;
use std::ffi::OsString;
use std::fs::{self, DirEntry, File};
use std::io::prelude::*;
use std::path::Path;
use std::process::{self, Command};

trait Stringable {
    fn to_string(self) -> String;
}

impl Stringable for DirEntry {
    fn to_string(self) -> String {
        self.path().as_path().to_str().unwrap().to_owned()
    }
}

impl Stringable for OsString {
    fn to_string(self) -> String {
        self.as_os_str().to_str().unwrap().to_owned()
    }
}

const INDEX_PATH: &'static str = "blaze/file_index.json";
const CONFIG_PATH: &'static str = "blaze/lint_config.json";

// Map from path to hash
#[derive(RustcDecodable, RustcEncodable, Default)]
pub struct Index {
    files: HashMap<String, String>,
}

#[derive(RustcDecodable)]
pub struct Lint {<commit_msg>update paths<commit_after>extern crate crypto;
extern crate regex;
extern crate rustc_serialize;

use crypto::md5::Md5;
use crypto::digest::Digest;

use rustc_serialize::{json, Decodable, Encodable};

use std::collections::HashMap;
use std::ffi::OsString;
use std::fs::{self, DirEntry, File};
use std::io::prelude::*;
use std::path::Path;
use std::process::{self, Command};

trait Stringable {
    fn to_string(self) -> String;
}

impl Stringable for DirEntry {
    fn to_string(self) -> String {
        self.path().as_path().to_str().unwrap().to_owned()
    }
}

impl Stringable for OsString {
    fn to_string(self) -> String {
        self.as_os_str().to_str().unwrap().to_owned()
    }
}

const INDEX_PATH: &'static str = ".roller_index.json";
const CONFIG_PATH: &'static str = ".roller_config.json";

// Map from path to hash
#[derive(RustcDecodable, RustcEncodable, Default)]
pub struct Index {
    files: HashMap<String, String>,
}

#[derive(RustcDecodable)]
pub struct Lint {
{'fraction_non_alphanumeric': 0.1549367088607595, 'fraction_numerical': 0.0020253164556962027, 'mean_word_length': 4.916167664670659, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3974477', 'n_tokens_mistral': 694, 'n_tokens_neox': 705, 'n_words': 163}