<commit_before>define('validate_transonic',
    ['defer', 'feed', 'jquery', 'l10n', 'underscore', 'utils_local',],
    function(defer, feed, $, l10n, _, utils_local) {
    'use strict';
    var gettext = l10n.gettext;

    var feed_app = function(data, $file_input, $preview) {
        var errs = [];
        if (!data.app) {
            errs.push(gettext('App is required.'));
        }
        if (!data.slug) {
            errs.push(gettext('Slug is required.'));
        } else if (!validate_slug(data.slug)) {
            errs.push(gettext('Slug is invalid.'));
        }
        if (!$file_input.val().length &&
            [feed.FEEDAPP_IMAGE].indexOf(data.type) !== -1 &&
            !$preview.attr('src')) {
            errs.push(gettext('Background image is required.'));
        }
        if (!validate_localized_field(data.description) &&
            [feed.FEEDAPP_DESC].indexOf(data.type) !== -1) {
            errs.push(gettext('Description is required.'));
        }
        if (!data.preview &&
            [feed.FEEDAPP_PREVIEW].indexOf(data.type) !== -1) {
            errs.push(gettext('Preview is required.'));
        }
        if (!validate_localized_field(data.pullquote_text) &&
            [feed.FEEDAPP_QUOTE].indexOf(data.type) !== -1) {
            errs.push(gettext('Quote text is required.'));
        }
        return errs;
    };

    var collection = function(data, $file_input, $preview) {
        var errs = [];
        if (!data.apps.length) {
            errs.push(gettext('Apps are required.'));
        }<commit_msg>add validation for quote if not on quote tab (bug 1032832)<commit_after>define('validate_transonic',
    ['defer', 'feed', 'jquery', 'l10n', 'underscore', 'utils_local',],
    function(defer, feed, $, l10n, _, utils_local) {
    'use strict';
    var gettext = l10n.gettext;

    var feed_app = function(data, $file_input, $preview) {
        var errs = [];
        if (!data.app) {
            errs.push(gettext('App is required.'));
        }
        if (!data.slug) {
            errs.push(gettext('Slug is required.'));
        } else if (!validate_slug(data.slug)) {
            errs.push(gettext('Slug is invalid.'));
        }
        if (!$file_input.val().length &&
            [feed.FEEDAPP_IMAGE].indexOf(data.type) !== -1 &&
            !$preview.attr('src')) {
            errs.push(gettext('Background image is required.'));
        }
        if (!validate_localized_field(data.description) &&
            [feed.FEEDAPP_DESC].indexOf(data.type) !== -1) {
            errs.push(gettext('Description is required.'));
        }
        if (!data.preview &&
            [feed.FEEDAPP_PREVIEW].indexOf(data.type) !== -1) {
            errs.push(gettext('Preview is required.'));
        }
        if (!validate_localized_field(data.pullquote_text) &&
            [feed.FEEDAPP_QUOTE].indexOf(data.type) !== -1) {
            errs.push(gettext('Quote text is required.'));
        }
        if (!validate_localized_field(data.pullquote_text) &&
            [feed.FEEDAPP_QUOTE].indexOf(data.type) === -1 &&
            data.pullquote_rating || data.pullquote_attribution) {
            errs.push(gettext('Quote text is required if quote rating or quote attribution is set.'));
        }
        return errs;
    };

    var collection = function(data, $file_input, $preview) {
        var errs = [];
        if (!data.apps.length) {
            errs.push(gettext('Apps are required.'));
        }
{'fraction_non_alphanumeric': 0.16247470367158137, 'fraction_numerical': 0.008094825093957791, 'mean_word_length': 2.1860036832412524, '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': '2472549', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1079, 'n_words': 196}