<commit_before>/**
 * # Spec
 *
 * This file contains details of the theme API spec, in a format that can be used by GScan
 */

var knownHelpers, templates, rules, ruleNext;

knownHelpers = [
    // Ghost
    'foreach', 'has', 'is', 'get', 'content', 'excerpt', 'title', 'tags', 'author', 'img_url', 'navigation', 'pagination',
    'page_url', 'url', 'date', 'plural', 'encode', 'asset', 'body_class', 'post_class', 'ghost_head', 'ghost_foot',
    'meta_title', 'meta_description', 'next_post', 'prev_post', 'twitter_url', 'facebook_url',
    // Ghost apps
    'input_email', 'input_password', 'amp_components', 'amp_content', 'amp_ghost_head', 'subscribe_form',
    // Handlebars and express handlebars
    // TODO add a warning that `each` should not be used because Ghost has special behaviour in `foreach`
    'log', 'if', 'unless', 'with', 'block', 'contentFor', 'each', 'lookup'
    // Registering these will break template compile checks
    // 'blockHelperMissing', 'helperMissing',
];

templates = [
    {
        name: 'Page template',
        pattern: /^page\.hbs$/,
        version: '>=0.4.0'
    },
    {
        name: 'Error template',
        pattern: /^error\.hbs$/,
        version: '>=0.4.0'
    },
    {
        name: 'Tag template',
        pattern: /^tag\.hbs$/,
        version: '>=0.4.2'
    },
    {
        name: 'Custom page template',
        pattern: /^page-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.4.2'
    },
    {
        name: 'Author template',
        pattern: /^author\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Home template',
        pattern: /^home\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Custom tag template',
        pattern: /^tag-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Custom author template',
        pattern: /^author-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.6.3'
    },
    {
        name: 'Private template',
        pattern: /^private\.hbs$/,
        version: '>=0.6.3'
    },
    {
        name: 'Custom post template',
        pattern: /^post-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.7.3'
    }
];

// @TODO: register rules in each checker!
rules = {
    "GS001-DEPR-PURL": {
        "level": "error",
        "rule": "Replace <code>{{pageUrl}}</code> with <code>{{page_url}}</code>.",
        "fatal": true
    },
    "GS001-DEPR-MD": {
        "level": "error",
        "rule": "Usage of <code>{{meta_description}}</code> in HTML <code>head</code> is deprecated."
    },
    "GS001-DEPR-IMG": {
        "level": "error",
        "rule": "Replace the <code>{{image}}</code> helper with <code>{{feature_image}}</code>, <code>{{cover_image}}</code> or <code>{{profile_image}}</code>."
    },
    "GS001-DEPR-AIMG": {
        "level": "error",
        "rule": "Replace the <code>{{author.image}}</code> helper with <code>{{author.profile_image}}</code>."
    },
    "GS001-DEPR-PIMG": {
        "level": "error",
        "rule": "Replace the <code>{{post.image}}</code> helper with <code>{{post.feature_image}}</code>."
    },
    "GS001-DEPR-BC": {
        "level": "error",
        "rule": "Replace the <code>{{@blog.cover}}</code> helper with <code>{{@blog.cover_image}}</code>."
    },
    "GS001-DEPR-AC": {
        "level": "error",
        "rule": "Replace the <code>{{author.cover}}</code> helper with <code>{{author.cover_image}}</code>."
    },
    "GS001-DEPR-TIMG": {
        "level": "error",
        "rule": "Replace the <code>{{tag.image}}</code> helper with <code>{{tag.feature_image}}</code>."
    },
    "GS001-DEPR-PPP": {
        "level": "error",
        "rule": "Replace <code>{{@blog.posts_per_page}}</code> with <code>{{@config.posts_per_page}}</code>.",
        "details": "<p>Please add <code>posts_per_page</code> to your <code>package.json</code>. E.g. <code>config: { posts_per_page: 5}</code>.</p>"
    },
    "GS001-DEPR-C0H": {
        "level": "error",
        "rule": "Replace <code>{{content words=\"0\"}}</code> with the <code>{{img_url}}</code> helper."
    },
    "GS001-DEPR-CSS-AT": {
        "level": "error",
        "rule": "Replace <code>.archive-template</code> with the <code>.paged</code> css class."
    },
    "GS001-DEPR-CSS-PA": {
        "level": "error",
        "rule": "Replace <code>.page</code> with the <code>.page-template</code> css class."
    },
    "GS001-DEPR-CSS-PATS": {
        "level": "error",
        "rule": "Replace <code>.page-template-slug</code> with the <code>.page-slug</code> css class."
    },
    "GS005-TPL-ERR": {
        "level": "error",
        "rule": "Templates must contain valid Handlebars.",
        "fatal": true
    },
    "GS010-PJ-REQ": {
        "level": "error",
        "rule": "package.json file should be present."
    },
    "GS010-PJ-PARSE": {
        "level": "error",
        "rule": "package.json JSON can be parsed."
    },
    "GS010-PJ-NAME-LC": {
        "level": "error",
        "rule": "package.json <code>name</code> must be lowercase."
    },
    "GS010-PJ-NAME-HY": {
        "level": "error",
        "rule": "package.json <code>name</code> must be hyphenated."
    },
    "GS010-PJ-NAME-REQ": {
        "level": "error",
        "rule": "package.json <code>name</code> is required."
    },
    "GS010-PJ-VERSION-SEM": {
        "level": "error",
        "rule": "package.json <code>version</code> must be semver compliant."
    },
    "GS010-PJ-VERSION-REQ": {
        "level": "error",
        "rule": "package.json <code>version</code> is required."
    },
    "GS010-PJ-AUT-EM-VAL": {
        "level": "error",
        "rule": "package.json <code>author.email</code> must be valid."
    },
    "GS010-PJ-CONF-PPP": {
        "level": "recommendation",
        "rule": "package.json <code>config.page_per_post</code> is recommended. Otherwise, it falls back to 5."
    },<commit_msg>🎨  package.json - version: optimise error message<commit_after>/**
 * # Spec
 *
 * This file contains details of the theme API spec, in a format that can be used by GScan
 */

var knownHelpers, templates, rules, ruleNext;

knownHelpers = [
    // Ghost
    'foreach', 'has', 'is', 'get', 'content', 'excerpt', 'title', 'tags', 'author', 'img_url', 'navigation', 'pagination',
    'page_url', 'url', 'date', 'plural', 'encode', 'asset', 'body_class', 'post_class', 'ghost_head', 'ghost_foot',
    'meta_title', 'meta_description', 'next_post', 'prev_post', 'twitter_url', 'facebook_url',
    // Ghost apps
    'input_email', 'input_password', 'amp_components', 'amp_content', 'amp_ghost_head', 'subscribe_form',
    // Handlebars and express handlebars
    // TODO add a warning that `each` should not be used because Ghost has special behaviour in `foreach`
    'log', 'if', 'unless', 'with', 'block', 'contentFor', 'each', 'lookup'
    // Registering these will break template compile checks
    // 'blockHelperMissing', 'helperMissing',
];

templates = [
    {
        name: 'Page template',
        pattern: /^page\.hbs$/,
        version: '>=0.4.0'
    },
    {
        name: 'Error template',
        pattern: /^error\.hbs$/,
        version: '>=0.4.0'
    },
    {
        name: 'Tag template',
        pattern: /^tag\.hbs$/,
        version: '>=0.4.2'
    },
    {
        name: 'Custom page template',
        pattern: /^page-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.4.2'
    },
    {
        name: 'Author template',
        pattern: /^author\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Home template',
        pattern: /^home\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Custom tag template',
        pattern: /^tag-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.5.0'
    },
    {
        name: 'Custom author template',
        pattern: /^author-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.6.3'
    },
    {
        name: 'Private template',
        pattern: /^private\.hbs$/,
        version: '>=0.6.3'
    },
    {
        name: 'Custom post template',
        pattern: /^post-([a-z0-9\-_]+)\.hbs$/,
        version: '>=0.7.3'
    }
];

// @TODO: register rules in each checker!
rules = {
    "GS001-DEPR-PURL": {
        "level": "error",
        "rule": "Replace <code>{{pageUrl}}</code> with <code>{{page_url}}</code>.",
        "fatal": true
    },
    "GS001-DEPR-MD": {
        "level": "error",
        "rule": "Usage of <code>{{meta_description}}</code> in HTML <code>head</code> is deprecated."
    },
    "GS001-DEPR-IMG": {
        "level": "error",
        "rule": "Replace the <code>{{image}}</code> helper with <code>{{feature_image}}</code>, <code>{{cover_image}}</code> or <code>{{profile_image}}</code>."
    },
    "GS001-DEPR-AIMG": {
        "level": "error",
        "rule": "Replace the <code>{{author.image}}</code> helper with <code>{{author.profile_image}}</code>."
    },
    "GS001-DEPR-PIMG": {
        "level": "error",
        "rule": "Replace the <code>{{post.image}}</code> helper with <code>{{post.feature_image}}</code>."
    },
    "GS001-DEPR-BC": {
        "level": "error",
        "rule": "Replace the <code>{{@blog.cover}}</code> helper with <code>{{@blog.cover_image}}</code>."
    },
    "GS001-DEPR-AC": {
        "level": "error",
        "rule": "Replace the <code>{{author.cover}}</code> helper with <code>{{author.cover_image}}</code>."
    },
    "GS001-DEPR-TIMG": {
        "level": "error",
        "rule": "Replace the <code>{{tag.image}}</code> helper with <code>{{tag.feature_image}}</code>."
    },
    "GS001-DEPR-PPP": {
        "level": "error",
        "rule": "Replace <code>{{@blog.posts_per_page}}</code> with <code>{{@config.posts_per_page}}</code>.",
        "details": "<p>Please add <code>posts_per_page</code> to your <code>package.json</code>. E.g. <code>config: { posts_per_page: 5}</code>.</p>"
    },
    "GS001-DEPR-C0H": {
        "level": "error",
        "rule": "Replace <code>{{content words=\"0\"}}</code> with the <code>{{img_url}}</code> helper."
    },
    "GS001-DEPR-CSS-AT": {
        "level": "error",
        "rule": "Replace <code>.archive-template</code> with the <code>.paged</code> css class."
    },
    "GS001-DEPR-CSS-PA": {
        "level": "error",
        "rule": "Replace <code>.page</code> with the <code>.page-template</code> css class."
    },
    "GS001-DEPR-CSS-PATS": {
        "level": "error",
        "rule": "Replace <code>.page-template-slug</code> with the <code>.page-slug</code> css class."
    },
    "GS005-TPL-ERR": {
        "level": "error",
        "rule": "Templates must contain valid Handlebars.",
        "fatal": true
    },
    "GS010-PJ-REQ": {
        "level": "error",
        "rule": "package.json file should be present."
    },
    "GS010-PJ-PARSE": {
        "level": "error",
        "rule": "package.json JSON can be parsed."
    },
    "GS010-PJ-NAME-LC": {
        "level": "error",
        "rule": "package.json <code>name</code> must be lowercase."
    },
    "GS010-PJ-NAME-HY": {
        "level": "error",
        "rule": "package.json <code>name</code> must be hyphenated."
    },
    "GS010-PJ-NAME-REQ": {
        "level": "error",
        "rule": "package.json <code>name</code> is required."
    },
    "GS010-PJ-VERSION-SEM": {
        "level": "error",
        "rule": "package.json <code>version</code> must be semver compliant (e.g. 1.0.0)."
    },
    "GS010-PJ-VERSION-REQ": {
        "level": "error",
        "rule": "package.json <code>version</code> is required."
    },
    "GS010-PJ-AUT-EM-VAL": {
        "level": "error",
        "rule": "package.json <code>author.email</code> must be valid."
    },
    "GS010-PJ-CONF-PPP": {
        "level": "recommendation",
        "rule": "package.json <code>config.page_per_post</code> is recommended. Otherwise, it falls back to 5."
    },
{'fraction_non_alphanumeric': 0.2151197477201057, 'fraction_numerical': 0.01917668115571465, 'mean_word_length': 2.399188876013905, 'pattern_counts': {'":': 144, '<': 159, '<?xml version=': 0, '>': 179, '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': '3334577', 'n_tokens_mistral': 4257, 'n_tokens_neox': 4053, 'n_words': 861}