From 2bdce6b2ccaa47f48450d11a94ddb2481baba18a Mon Sep 17 00:00:00 2001 From: Allan Stromfeldt Christensen Date: Thu, 1 Apr 2021 20:52:34 +1100 Subject: [PATCH] Fix spacing mistakes --- lib/specs/canary.js | 14 ++++++------- lib/specs/v1.js | 23 +++++++++------------ lib/specs/v2.js | 49 ++++++++++++++++++++++----------------------- lib/specs/v3.js | 2 +- 4 files changed, 41 insertions(+), 47 deletions(-) diff --git a/lib/specs/canary.js b/lib/specs/canary.js index 5bd0b572..ab1a06b2 100644 --- a/lib/specs/canary.js +++ b/lib/specs/canary.js @@ -40,7 +40,7 @@ let rules = { level: 'warning', rule: 'The {{@labs.members}} helper should not be used.', details: oneLineTrim`Please remove {{@labs.members}} from the theme.
- The {{@labs.members}} helper will always return true in Ghost v4 and will be removed from Ghost v5, at which point it will return null and evaluate to false. + The {{@labs.members}} helper will always return true in Ghost v4 and will be removed from Ghost v5, at which point it will return null and evaluate to false.
Find more information about the @labs property here.`, regex: /@labs\.members/g, helper: '{{@labs.members}}' @@ -48,7 +48,7 @@ let rules = { 'GS080-FEACH-POSTS': { level: 'warning', rule: 'The default visibility for posts in {{#foreach}} block helper has changed in v4.', - details: oneLineTrim`The default visibility for posts in {{#foreach}} block helper has changed from public to all in Ghost v4. + details: oneLineTrim`The default visibility for posts in {{#foreach}} block helper has changed from public to all in Ghost v4.
Find more information about the {{foreach}} helper here.`, regex: /{{\s*?#foreach\s*?\w*?\s*?}}/g, helper: '{{#foreach}}', @@ -57,7 +57,7 @@ let rules = { 'GS080-CARD-LAST4': { level: 'warning', rule: 'The default_payment_card_last4 field now coalesces to **** in Ghost 4.x instead of null.', - details: oneLineTrim`The default_payment_card_last4 field no longer outputs a falsy(null) value in case of missing card details starting from Ghost 4.x and instead coalesces to **** + details: oneLineTrim`The default_payment_card_last4 field no longer outputs a falsy(null) value in case of missing card details starting from Ghost 4.x and instead coalesces to ****
Find more information about the default_payment_card_last4 attribute here.`, regex: /default_payment_card_last4/g, helper: '{{default_payment_card_last4}}', @@ -66,8 +66,8 @@ let rules = { 'GS080-FEACH-PV': { level: 'recommendation', rule: 'The use of visibility="all" is no longer required for posts in {{#foreach}} helper.', - details: oneLineTrim`The default visibility in {{#foreach}} helper for posts has changed in v4 from "public" to "all" and is no longer required when looping over posts. - Check out the documentation for {{#foreach}} here.
.`, + details: oneLineTrim`The default visibility in {{#foreach}} helper for posts has changed in v4 from "public" to "all" and is no longer required when looping over posts.
+ Check out the documentation for {{#foreach}} here.`, regex: /{{\s*?#foreach\b[\w\s='"]*?visibility=("|')all("|')[\w\s='"]*?}}/g, helper: '{{#foreach}}', validInAPI: ['v3'] @@ -75,7 +75,7 @@ let rules = { 'GS001-DEPR-CURR-SYM': { level: 'warning', rule: 'Replace {{[#].currency_symbol}} with {{price currency=currency}}.', - details: oneLineTrim`The hardcoded currency_symbol attribute was removed in favour of passing the currency to updated {{price}} helper. + details: oneLineTrim`The hardcoded currency_symbol attribute was removed in favour of passing the currency to updated {{price}} helper.
Find more information about the updated {{price}} helper here.`, helper: '{{[#].currency_symbol}}', regex: /currency_symbol/g @@ -84,7 +84,7 @@ let rules = { level: 'warning', rule: 'The {{@site.lang}} helper should be replaced with {{@site.locale}}', details: oneLineTrim`Please replace {{@site.lang}} helper with {{@site.locale}}.
- The {{@site.lang}} helper will be removed in next version of Ghost and should not be used. + The {{@site.lang}} helper will be removed in next version of Ghost and should not be used.
Find more information about the @site property here.`, regex: /@site\.lang/g, helper: '{{@site.lang}}' diff --git a/lib/specs/v1.js b/lib/specs/v1.js index e03d4287..a4fe671d 100644 --- a/lib/specs/v1.js +++ b/lib/specs/v1.js @@ -99,8 +99,7 @@ rules = { details: oneLineTrim`The {{image}} helper was replaced with the {{img_url}} helper.
Depending on the context of the {{img_url}} helper you would need to use e. g.

{{#post}}
    {{img_url feature_image}}
{{/post}}


to render the feature image of the blog post.

If you are using {{if image}}, then you have to replace it with e.g. {{if feature_image}}. -

Find more information about the {{img_url}} helper here and - read more about Ghost's usage of contexts here.`, +

Find more information about the {{img_url}} helper here and read more about Ghost's usage of contexts here.`, regex: /{{\s*?image\b[\w\s='"]*?}}/g, helper: '{{image}}' }, @@ -365,22 +364,18 @@ rules = { level: 'error', rule: 'Replace {{id}} with {{comment_id}} in Disqus embeds.', fatal: true, - details: oneLineTrim`The output of {{id}} has changed in v1.0.0 from an incremental ID to an ObjectID. - This results in Disqus comments not loading in Ghost v1.0.0 posts which were imported from earlier versions. - To resolve this, we've added a {{comment_id}} helper that will output the old ID - for posts that have been imported from earlier versions, and ID for new posts. - The Disqus embed must be updated from this.page.identifier = 'ghost-{{id}}'; to - this.page.identifier = 'ghost-{{comment_id}}'; to ensure Disqus continues to work.`, + details: oneLineTrim`The output of {{id}} has changed in v1.0.0 from an incremental ID to an ObjectID.
+ This results in Disqus comments not loading in Ghost v1.0.0 posts which were imported from earlier versions.
+ To resolve this, we've added a {{comment_id}} helper that will output the old ID for posts that have been imported from earlier versions, and ID for new posts.
+ The Disqus embed must be updated from this.page.identifier = 'ghost-{{id}}'; to this.page.identifier = 'ghost-{{comment_id}}'; to ensure Disqus continues to work.`, regex: /(page\.|disqus_)identifier\s?=\s?['"].*?({{\s*?id\s*?}}).*?['"];?/g }, 'GS002-ID-HELPER': { level: 'recommendation', rule: 'The output of {{id}} changed in Ghost v1.0.0, you may need to use {{comment_id}} instead.', - details: oneLineTrim`The output of {{id}} has changed in v1.0.0 from an incremental ID to an ObjectID. - In v1.0.0 we added a {{comment_id}} helper that will output the old ID - for posts that have been imported from earlier versions, and ID for new posts. - If you need the old ID to be output on imported posts, then you will need to use - {{comment_id}} rather than {{id}}.`, + details: oneLineTrim`The output of {{id}} has changed in v1.0.0 from an incremental ID to an ObjectID.
+ In v1.0.0 we added a {{comment_id}} helper that will output the old ID for posts that have been imported from earlier versions, and ID for new posts.
+ If you need the old ID to be output on imported posts, then you will need to use {{comment_id}} rather than {{id}}.`, regex: /({{\s*?id\s*?}})/g }, 'GS005-TPL-ERR': { @@ -401,7 +396,7 @@ rules = { rule: 'package.json file can be parsed', details: oneLineTrim`Your package.json file couldn't be parsed. This is mostly caused by a missing or unnecessary ',' or the wrong usage of '""'.
Check the package.json documentation for further information.
- A good reference for your package.json file is always the latest version of Casper.` + A good reference for your package.json file is always the latest version of Casper.` }, 'GS010-PJ-NAME-LC': { level: 'error', diff --git a/lib/specs/v2.js b/lib/specs/v2.js index d7982b0a..758c17c0 100644 --- a/lib/specs/v2.js +++ b/lib/specs/v2.js @@ -57,8 +57,7 @@ let rules = { 'GS001-DEPR-AUTHBL': { level: 'error', rule: 'The {{#author}} block helper should be replaced with {{#primary_author}} or {{#foreach authors}}...{{/foreach}}', - details: oneLineTrim`The usage of {{#author}} block helper outside of author.hbs is deprecated and - should be replaced with {{#primary_author}} or {{#foreach authors}}...{{/foreach}}.
+ details: oneLineTrim`The usage of {{#author}} block helper outside of author.hbs is deprecated and should be replaced with {{#primary_author}} or {{#foreach authors}}...{{/foreach}}.
Find more information about the {{authors}} helper here.`, regex: /{{\s*?#author\s*?}}/g, notValidIn: 'author.hbs', @@ -384,7 +383,7 @@ let rules = { level: 'error', rule: 'The {{@blog}} helper should be replaced with {{@site}}', details: oneLineTrim`With the introduction of the Content API {{@blog}} became deprecated in favour of {{@site}}.
- The {{@blog}} helper will be removed in next version of Ghost and should not be used. + The {{@blog}} helper will be removed in next version of Ghost and should not be used.
Find more information about the @site property here.`, regex: /{{\s*?@blog\.[a-zA-Z0-9_]+\s*?}}/g, helper: '{{@blog}}' @@ -393,7 +392,7 @@ let rules = { level: 'error', rule: '{{@blog.permalinks}} was removed', details: oneLineTrim`With the introduction of Dynamic Routing, you can define multiple permalinks.
- The {{@blog.permalinks}} property will therefore no longer be used and should be removed from the theme. + The {{@blog.permalinks}} property will therefore no longer be used and should be removed from the theme.
Find more information about Ghost data helpers here.`, regex: /{{\s*?@blog\.permalinks\s*?}}/g, helper: '{{@blog.permalinks}}' @@ -402,7 +401,7 @@ let rules = { level: 'error', rule: '{{@site.permalinks}} was removed', details: oneLineTrim`With the introduction of Dynamic Routing, you can define multiple permalinks.
- The {{@site.permalinks}} property will therefore no longer be used and should be removed from the theme. + The {{@site.permalinks}} property will therefore no longer be used and should be removed from the theme.
Find more information about the @site property here.`, regex: /{{\s*?@site\.permalinks\s*?}}/g, helper: '{{@site.permalinks}}' @@ -411,7 +410,7 @@ let rules = { level: 'error', rule: 'Replace {{@site.ghost_head}} with {{ghost_head}}', details: oneLineTrim`The usage of {{@site.ghost_head}} is deprecated and should be replaced with {{ghost_head}}.
- The {{@site.ghost_head}} property will therefore no longer be used and should be removed from the theme. + The {{@site.ghost_head}} property will therefore no longer be used and should be removed from the theme.
Find more information about the {{ghost_head}} property here.`, regex: /{{\s*?@site\.ghost_head\s*?}}/g, helper: '{{@site.ghost_head}}' @@ -420,7 +419,7 @@ let rules = { level: 'error', rule: 'Replace {{@site.ghost_foot}} with {{ghost_foot}}', details: oneLineTrim`The usage of {{@site.ghost_foot}} is deprecated and should be replaced with {{ghost_foot}}.
- The {{@site.ghost_foot}} property will therefore no longer be used and should be removed from the theme. + The {{@site.ghost_foot}} property will therefore no longer be used and should be removed from the theme.
Find more information about the {{ghost_foot}} property here.`, regex: /{{\s*?@site\.ghost_foot\s*?}}/g, helper: '{{@site.ghost_foot}}' @@ -429,7 +428,7 @@ let rules = { level: 'error', rule: 'The {{lang}} helper should be replaced with {{@site.lang}}', details: oneLineTrim`The {{lang}} helper is a duplicate of {{@site.lang}}. Using {{@site.lang}} is preferred.
- The {{lang}} helper will be removed in next version of Ghost and should not be used. + The {{lang}} helper will be removed in next version of Ghost and should not be used.
Find more information about the @site.lang property here.`, regex: /{{\s*?lang\s*?}}/g, helper: '{{lang}}' @@ -437,8 +436,8 @@ let rules = { 'GS001-DEPR-CSS-KGMD': { level: 'warning', rule: `.kg-card-markdown doesn't exist in current version of Ghost, ensure your theme works without it`, - details: oneLineTrim`The .kg-card-markdown CSS class is deprecated and will no longer be used in Ghost. - It's recommended to add your own wrapper around the {{content}} helper and target that instead if needed. + details: oneLineTrim`The .kg-card-markdown CSS class is deprecated and will no longer be used in Ghost.
+ It's recommended to add your own wrapper around the {{content}} helper and target that instead if needed.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-card-markdown/g, className: '.kg-card-markdown', @@ -447,7 +446,7 @@ let rules = { 'GS050-CSS-KGWW': { level: 'error', rule: 'The .kg-width-wide CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-width-wide CSS class is required otherwise wide images will appear unstyled. + details: oneLineTrim`The .kg-width-wide CSS class is required otherwise wide images will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-width-wide/g, className: '.kg-width-wide', @@ -456,7 +455,7 @@ let rules = { 'GS050-CSS-KGWF': { level: 'error', rule: 'The .kg-width-full CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-width-full CSS class is required otherwise full width images will appear unstyled. + details: oneLineTrim`The .kg-width-full CSS class is required otherwise full width images will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-width-full/g, className: '.kg-width-full', @@ -465,7 +464,7 @@ let rules = { 'GS050-CSS-KGGC': { level: 'error', rule: 'The .kg-gallery-container CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-gallery-container CSS class is required otherwise galleries will appear unstyled. + details: oneLineTrim`The .kg-gallery-container CSS class is required otherwise galleries will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-gallery-container/g, className: '.kg-gallery-container', @@ -474,7 +473,7 @@ let rules = { 'GS050-CSS-KGGR': { level: 'error', rule: 'The .kg-gallery-row CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-gallery-row CSS class is required otherwise gallery rows will appear unstyled. + details: oneLineTrim`The .kg-gallery-row CSS class is required otherwise gallery rows will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-gallery-row/g, className: '.kg-gallery-row', @@ -483,7 +482,7 @@ let rules = { 'GS050-CSS-KGGI': { level: 'error', rule: 'The .kg-gallery-image CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-gallery-image CSS class is required otherwise gallery images will appear unstyled. + details: oneLineTrim`The .kg-gallery-image CSS class is required otherwise gallery images will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-gallery-image/g, className: '.kg-gallery-image', @@ -492,7 +491,7 @@ let rules = { 'GS050-CSS-KGBM': { level: 'error', rule: 'The .kg-bookmark-card CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-card CSS class is required otherwise the bookmark card will appear unstyled. + details: oneLineTrim`The .kg-bookmark-card CSS class is required otherwise the bookmark card will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-card/g, className: '.kg-bookmark-card', @@ -501,7 +500,7 @@ let rules = { 'GS050-CSS-KGBMCO': { level: 'error', rule: 'The .kg-bookmark-container CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-card CSS class is required otherwise the bookmark card will appear unstyled. + details: oneLineTrim`The .kg-bookmark-card CSS class is required otherwise the bookmark card will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-container/g, className: '.kg-bookmark-container', @@ -510,7 +509,7 @@ let rules = { 'GS050-CSS-KGBMCON': { level: 'error', rule: 'The .kg-bookmark-content CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-content CSS class is required otherwise the bookmark card main content will appear unstyled. + details: oneLineTrim`The .kg-bookmark-content CSS class is required otherwise the bookmark card main content will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-content/g, className: '.kg-bookmark-content', @@ -519,7 +518,7 @@ let rules = { 'GS050-CSS-KGBMTI': { level: 'error', rule: 'The .kg-bookmark-title CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-title CSS class is required otherwise the bookmark card title will appear unstyled. + details: oneLineTrim`The .kg-bookmark-title CSS class is required otherwise the bookmark card title will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-title/g, className: '.kg-bookmark-title', @@ -528,7 +527,7 @@ let rules = { 'GS050-CSS-KGBMDE': { level: 'error', rule: 'The .kg-bookmark-description CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-description CSS class is required otherwise the bookmark card description will appear unstyled. + details: oneLineTrim`The .kg-bookmark-description CSS class is required otherwise the bookmark card description will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-description/g, className: '.kg-bookmark-description', @@ -537,7 +536,7 @@ let rules = { 'GS050-CSS-KGBMME': { level: 'error', rule: 'The .kg-bookmark-metadata CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-metadata CSS class is required otherwise the bookmark card meta details will appear unstyled. + details: oneLineTrim`The .kg-bookmark-metadata CSS class is required otherwise the bookmark card meta details will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-metadata/g, className: '.kg-bookmark-metadata', @@ -546,7 +545,7 @@ let rules = { 'GS050-CSS-KGBMIC': { level: 'error', rule: 'The .kg-bookmark-icon CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-icon CSS class is required otherwise the bookmark card author icon will appear unstyled. + details: oneLineTrim`The .kg-bookmark-icon CSS class is required otherwise the bookmark card author icon will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-icon/g, className: '.kg-bookmark-icon', @@ -555,7 +554,7 @@ let rules = { 'GS050-CSS-KGBMAU': { level: 'error', rule: 'The .kg-bookmark-author CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-author CSS class is required otherwise the bookmark card author name will appear unstyled. + details: oneLineTrim`The .kg-bookmark-author CSS class is required otherwise the bookmark card author name will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-author/g, className: '.kg-bookmark-author', @@ -564,7 +563,7 @@ let rules = { 'GS050-CSS-KGBMPU': { level: 'error', rule: 'The .kg-bookmark-publisher CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-publisher CSS class is required otherwise the bookmark card publisher name will appear unstyled. + details: oneLineTrim`The .kg-bookmark-publisher CSS class is required otherwise the bookmark card publisher name will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-publisher/g, className: '.kg-bookmark-publisher', @@ -573,7 +572,7 @@ let rules = { 'GS050-CSS-KGBMTH': { level: 'error', rule: 'The .kg-bookmark-thumbnail CSS class is required to appear styled in your theme', - details: oneLineTrim`The .kg-bookmark-thumbnail CSS class is required otherwise the bookmark card thumbnail image will appear unstyled. + details: oneLineTrim`The .kg-bookmark-thumbnail CSS class is required otherwise the bookmark card thumbnail image will appear unstyled.
Find out more about required theme changes for the Koenig editor here.`, regex: /\.kg-bookmark-thumbnail/g, className: '.kg-bookmark-thumbnail', diff --git a/lib/specs/v3.js b/lib/specs/v3.js index 6d877a52..d40e426f 100644 --- a/lib/specs/v3.js +++ b/lib/specs/v3.js @@ -34,7 +34,7 @@ let rules = { level: 'error', rule: 'Replace {{error.code}} with {{error.statusCode}}', details: oneLineTrim`The usage of {{error.code}} is deprecated and should be replaced with {{error.statusCode}}.
- When in error context, e. g. in the error.hbs template, replace {{code}} with {{statusCode}}.
+ When in error context, e.g. in the error.hbs template, replace {{code}} with {{statusCode}}.
Find more information about the error.hbs template here.`, regex: /{{\s*?(?:error\.)?(code)\s*?}}/g, helper: '{{error.code}}'