<commit_before>var AsciiTable = require('ascii-table');

module.exports = function consoleRenderer(report) {
    var lastFileName, table = new AsciiTable().setHeading('File', 'Dependency', 'Version');

    report.getDependencies().forEach(function (dependency) {
        var currentFileName = dependency.getFileName(),
            fileName = !lastFileName || lastFileName !== currentFileName ? currentFileName : '';

        table.addRow(fileName, dependency.getName(), dependency.getVersion());

        lastFileName = currentFileName;
    });

    console.log(table.toString());
};<commit_msg>(feat): sort depq table by file name<commit_after>var AsciiTable = require('ascii-table');

module.exports = function consoleRenderer(report) {
    var lastFileName, table = new AsciiTable().setHeading('File', 'Dependency', 'Version');

    report.getDependencies()
        .sort(byFileName)
        .forEach(function (dependency) {
            var currentFileName = dependency.getFileName(),
                fileName = !lastFileName || lastFileName !== currentFileName ? currentFileName : '';

            table.addRow(fileName, dependency.getName(), dependency.getVersion());

            lastFileName = currentFileName;
        });

    console.log(table.toString());
};

function byFileName(dependency1, dependency2) {
    return dependency1.getFileName() < dependency2.getFileName() ? -1 : 1;
}
{'fraction_non_alphanumeric': 0.133428981348637, 'fraction_numerical': 0.00430416068866571, 'mean_word_length': 3.8269896193771626, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6265654', 'n_tokens_mistral': 356, 'n_tokens_neox': 342, 'n_words': 74}