<commit_before>"use strict";

const Head = require("./branch").Head;
const MergeBase = require("./branch").MergeBase;
const WattsiHead = require("./branch").WattsiHead;
const WattsiMergeBase = require("./branch").WattsiMergeBase;
const SpecDiff = require("./spec-diff");

class File {
    constructor(pr, filename) {
        this._pr = pr;
        this._filename = filename;
    }
    
    get pr() {
        return this._pr;
    }

    get head() {
        return this._head = this._head || Head.fromPR(this.pr, this.filename);
    }
    
    get merge_base() {
        return this._merge_base = this._merge_base || MergeBase.fromPR(this.pr, this.filename);
    }
    
    get filename() {
        return this._filename;
    }
    
    get isRoot() {
        return !this.filename;
    }
    
    get diff() {
        return this._diff = this._diff || new SpecDiff(this.head, this.merge_base, this.filename);
    }

    cache() {
        return Promise.all([this.head.cache(), this.merge_base.cache()])
            .then(_ => this.diff.cache());
    } 
}

class WattsiFile extends File {
    constructor(pr, wattsi, filename) {
        super(pr, filename);
        console.log(this.filename);
        this._wattsi = wattsi;
    }

    get head() {
        return this._head = this._head ||
            WattsiHead.fromPR(this.pr, this._wattsi.headPath(this.filename), this.filename);
    }
    
    get merge_base() {
        return this._merge_base = this._merge_base ||
            WattsiMergeBase.fromPR(this.pr, this._wattsi.mergeBasePath(this.filename), this.filename);
    }
}

module.exports = File;
module.exports.WattsiFile = WattsiFile;<commit_msg>More logging<commit_after>"use strict";

const Head = require("./branch").Head;
const MergeBase = require("./branch").MergeBase;
const WattsiHead = require("./branch").WattsiHead;
const WattsiMergeBase = require("./branch").WattsiMergeBase;
const SpecDiff = require("./spec-diff");

class File {
    constructor(pr, filename) {
        this._pr = pr;
        this._filename = filename;
    }
    
    get pr() {
        return this._pr;
    }

    get head() {
        return this._head = this._head || Head.fromPR(this.pr, this.filename);
    }
    
    get merge_base() {
        return this._merge_base = this._merge_base || MergeBase.fromPR(this.pr, this.filename);
    }
    
    get filename() {
        return this._filename;
    }
    
    get isRoot() {
        return !this.filename;
    }
    
    get diff() {
        return this._diff = this._diff || new SpecDiff(this.head, this.merge_base, this.filename);
    }

    cache() {
        return Promise.all([this.head.cache(), this.merge_base.cache()])
            .then(_ => this.diff.cache());
    } 
}

class WattsiFile extends File {
    constructor(pr, wattsi, filename) {
        super(pr, filename);
        console.log("this.filename", this.filename);
        this._wattsi = wattsi;
    }

    get head() {
        return this._head = this._head ||
            WattsiHead.fromPR(this.pr, this._wattsi.headPath(this.filename), this.filename);
    }
    
    get merge_base() {
        return this._merge_base = this._merge_base ||
            WattsiMergeBase.fromPR(this.pr, this._wattsi.mergeBasePath(this.filename), this.filename);
    }
}

module.exports = File;
module.exports.WattsiFile = WattsiFile;
{'fraction_non_alphanumeric': 0.1398559423769508, 'fraction_numerical': 0.0, 'mean_word_length': 2.436082474226804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5729546', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1060, 'n_words': 197}