<commit_before>var gulp      = require("gulp"),
    fs        = require("fs"),
    rename    = require("gulp-rename"),
    del       = require("del"),
    swig      = require("gulp-swig"),
    data      = require("gulp-data"),
    ga        = require("gulp-ga"),
    jsonlint  = require("gulp-jsonlint");
    
var translations = JSON.parse(fs.readFileSync("_trans/_config.json")),
    rtl = ["fa", "ar"],
    sites,
    trans,
    notes;

gulp.task("jsonlint", function() {
    gulp.src("sites.json")
        .pipe(jsonlint())
        .pipe(jsonlint.reporter());
});
    
gulp.task("clean", function(callback) {
    return del(["docs/*.html"], callback);
});

gulp.task("translate", ["clean"], function() {
    
    translations.forEach(function(translation) {
        
        sites = JSON.parse(fs.readFileSync("sites.json"));
        trans = JSON.parse(fs.readFileSync("_trans/" + translation.code + ".json"));
        
        if (translation.code !== "en") {
            sites.forEach(function(site, i) {
                if (site.notes) {
                    site.notes = site["notes_"+translation.code] ? site["notes_"+translation.code] : site.notes;
                    sites[i] = site;
                }
            });
        }
        
        gulp.src("template.html")
            .pipe(rename((translation.code === "en" ? "index" : translation.code) + ".html"))
            .pipe(data({
                trans: translation,
                i18n: trans,
                sites: sites,
                rtl: (rtl.indexOf(translation.code) === -1) ? false : true,
                assetPath: "assets"
            }))
            .pipe(swig())
            .pipe(ga({url: "tupaschoal.github.io/justdelete.me/", uid: "UA-45971598-4"}))
            .pipe(gulp.dest("docs"));
    });
  
});

gulp.task("default", ["jsonlint", "translate"]);<commit_msg>Use property shorthand<commit_after>var gulp      = require("gulp"),
    fs        = require("fs"),
    rename    = require("gulp-rename"),
    del       = require("del"),
    swig      = require("gulp-swig"),
    data      = require("gulp-data"),
    ga        = require("gulp-ga"),
    jsonlint  = require("gulp-jsonlint");
    
var translations = JSON.parse(fs.readFileSync("_trans/_config.json")),
    rtl = ["fa", "ar"],
    sites,
    trans,
    notes;

gulp.task("jsonlint", function() {
    gulp.src("sites.json")
        .pipe(jsonlint())
        .pipe(jsonlint.reporter());
});
    
gulp.task("clean", function(callback) {
    return del(["docs/*.html"], callback);
});

gulp.task("translate", ["clean"], function() {
    
    translations.forEach(function(translation) {
        
        sites = JSON.parse(fs.readFileSync("sites.json"));
        trans = JSON.parse(fs.readFileSync("_trans/" + translation.code + ".json"));
        
        if (translation.code !== "en") {
            sites.forEach(function(site, i) {
                if (site.notes) {
                    site.notes = site["notes_"+translation.code] ? site["notes_"+translation.code] : site.notes;
                    sites[i] = site;
                }
            });
        }
        
        gulp.src("template.html")
            .pipe(rename((translation.code === "en" ? "index" : translation.code) + ".html"))
            .pipe(data({
                trans: translation,
                i18n: trans,
                sites,
                rtl: (rtl.indexOf(translation.code) === -1) ? false : true,
                assetPath: "assets"
            }))
            .pipe(swig())
            .pipe(ga({url: "tupaschoal.github.io/justdelete.me/", uid: "UA-45971598-4"}))
            .pipe(gulp.dest("docs"));
    });
  
});

gulp.task("default", ["jsonlint", "translate"]);
{'fraction_non_alphanumeric': 0.18096008629989213, 'fraction_numerical': 0.006472491909385114, 'mean_word_length': 1.9113029827315542, 'pattern_counts': {'":': 0, '<': 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': '7002506', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1131, 'n_words': 176}