diff --git a/lib/specs/canary.js b/lib/specs/canary.js index 3ef6b69e2..a0fa7b829 100644 --- a/lib/specs/canary.js +++ b/lib/specs/canary.js @@ -29,7 +29,6 @@ let rules = { If "ghost-api" property is left at "v0.1", Ghost will use its default setting of "v3".
Check the package.json documentation for further information.` }, - // Updated v2 rules 'GS001-DEPR-ESC': { level: 'error', rule: 'Replace {{error.code}} with {{error.statusCode}}', diff --git a/lib/specs/v2.js b/lib/specs/v2.js index 9ce288468..1230fc2c3 100644 --- a/lib/specs/v2.js +++ b/lib/specs/v2.js @@ -380,15 +380,6 @@ let rules = { regex: /{{\s*?img_url\s*?(author.).*}}/g, helper: '{{img_url author.*}}' }, - 'GS001-DEPR-ESC': { - level: 'error', - rule: 'Replace {{error.statusCode}} with {{error.code}}', - details: oneLineTrim`The usage of {{error.statusCode}} is deprecated and should be replaced with {{error.code}}.
- When in error context, e. g. in the error.hbs template, replace {{statusCode}} with {{code}}.
- Find more information about the error.hbs template here.`, - regex: /{{\s*?(?:error\.)?(statusCode)\s*?}}/g, - helper: '{{error.statusCode}}' - }, 'GS001-DEPR-BLOG': { level: 'error', rule: 'The {{@blog}} helper should be replaced with {{@site}}', diff --git a/test/001-deprecations.test.js b/test/001-deprecations.test.js index bb160916b..d18c6d1d8 100644 --- a/test/001-deprecations.test.js +++ b/test/001-deprecations.test.js @@ -246,7 +246,6 @@ describe('001 Deprecations', function () { 'GS001-DEPR-PAUTH-URL', 'GS001-DEPR-NAUTH', 'GS001-DEPR-IUA', - 'GS001-DEPR-ESC', 'GS001-DEPR-BPL', 'GS001-DEPR-SGH', 'GS001-DEPR-SGF', @@ -506,10 +505,6 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-IUA'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-IUA'].failures.length.should.eql(1); - // {{error.statusCode}} - output.results.fail['GS001-DEPR-ESC'].should.be.a.ValidFailObject(); - output.results.fail['GS001-DEPR-ESC'].failures.length.should.eql(2); - // {{@blog}} output.results.fail['GS001-DEPR-BLOG'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-BLOG'].failures.length.should.eql(2); @@ -539,7 +534,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-EACH'].failures.length.should.eql(1); // there are some single author rules which are not invalid for this theme. - output.results.pass.length.should.eql(17); + output.results.pass.length.should.eql(18); done(); }).catch(done); @@ -590,7 +585,6 @@ describe('001 Deprecations', function () { 'GS001-DEPR-NAUTH', 'GS001-DEPR-IUA', 'GS001-DEPR-AIMG-2', - 'GS001-DEPR-ESC', 'GS001-DEPR-BLOG', 'GS001-DEPR-BPL', 'GS001-DEPR-SPL', @@ -759,10 +753,6 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-AIMG-2'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-AIMG-2'].failures.length.should.eql(1); - // {{error.statusCode}} - output.results.fail['GS001-DEPR-ESC'].should.be.a.ValidFailObject(); - output.results.fail['GS001-DEPR-ESC'].failures.length.should.eql(2); - // {{@blog.*}} output.results.fail['GS001-DEPR-BLOG'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-BLOG'].failures.length.should.eql(1); @@ -783,7 +773,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-EACH'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-EACH'].failures.length.should.eql(1); - output.results.pass.should.be.an.Array().with.lengthOf(46); + output.results.pass.should.be.an.Array().with.lengthOf(47); done(); }).catch(done); @@ -837,7 +827,6 @@ describe('001 Deprecations', function () { 'GS001-DEPR-PAUTH-LOC', 'GS001-DEPR-NAUTH', 'GS001-DEPR-IUA', - 'GS001-DEPR-ESC', 'GS001-DEPR-BPL', 'GS001-DEPR-BLOG' ); @@ -848,7 +837,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-AUTH'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-AUTH'].failures.length.should.eql(1); - output.results.pass.should.be.an.Array().with.lengthOf(58); + output.results.pass.should.be.an.Array().with.lengthOf(59); done(); }).catch(done); @@ -1222,7 +1211,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-EACH'].failures.length.should.eql(1); // there are some single author rules which are not invalid for this theme. - output.results.pass.length.should.eql(17); + output.results.pass.length.should.eql(18); done(); }).catch(done); @@ -1466,7 +1455,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-EACH'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-EACH'].failures.length.should.eql(1); - output.results.pass.should.be.an.Array().with.lengthOf(46); + output.results.pass.should.be.an.Array().with.lengthOf(47); done(); }).catch(done); @@ -1477,7 +1466,7 @@ describe('001 Deprecations', function () { output.should.be.a.ValidThemeObject(); output.results.fail.should.be.an.Object().which.is.empty(); - output.results.pass.should.be.an.Array().with.lengthOf(92); + output.results.pass.should.be.an.Array().with.lengthOf(93); done(); }).catch(done); @@ -1531,7 +1520,7 @@ describe('001 Deprecations', function () { output.results.fail['GS001-DEPR-AUTH'].should.be.a.ValidFailObject(); output.results.fail['GS001-DEPR-AUTH'].failures.length.should.eql(1); - output.results.pass.should.be.an.Array().with.lengthOf(58); + output.results.pass.should.be.an.Array().with.lengthOf(59); done(); }).catch(done); diff --git a/test/fixtures/themes/001-deprecations/v2/invalid_all/default.hbs b/test/fixtures/themes/001-deprecations/v2/invalid_all/default.hbs index 02ab52583..afe3e8ef7 100644 --- a/test/fixtures/themes/001-deprecations/v2/invalid_all/default.hbs +++ b/test/fixtures/themes/001-deprecations/v2/invalid_all/default.hbs @@ -32,7 +32,7 @@ {{author_image}} {{#if error}} - {{error.statusCode}} + {{error.code}} {{/if}} {{#each}} diff --git a/test/fixtures/themes/001-deprecations/v2/invalid_all/error.hbs b/test/fixtures/themes/001-deprecations/v2/invalid_all/error.hbs index 2d745169d..92f4a7672 100644 --- a/test/fixtures/themes/001-deprecations/v2/invalid_all/error.hbs +++ b/test/fixtures/themes/001-deprecations/v2/invalid_all/error.hbs @@ -1 +1 @@ -{{statusCode}} \ No newline at end of file +{{code}} \ No newline at end of file diff --git a/test/general.test.js b/test/general.test.js index c71961487..24d4178d3 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -439,7 +439,7 @@ describe('Checker', function () { {file: 'README.md', ext: '.md'} ]); - theme.results.pass.should.be.an.Array().with.lengthOf(97); + theme.results.pass.should.be.an.Array().with.lengthOf(98); theme.results.pass.should.containEql('GS005-TPL-ERR', 'GS030-ASSET-REQ', 'GS030-ASSET-SYM'); theme.results.fail.should.be.an.Object().with.keys( @@ -510,7 +510,7 @@ describe('Checker', function () { {file: 'README.md', ext: '.md'} ]); - theme.results.pass.should.be.an.Array().with.lengthOf(97); + theme.results.pass.should.be.an.Array().with.lengthOf(98); theme.results.pass.should.containEql('GS005-TPL-ERR', 'GS030-ASSET-REQ', 'GS030-ASSET-SYM'); theme.results.fail.should.be.an.Object().with.keys( @@ -612,15 +612,14 @@ describe('format', function () { theme.results.recommendation.all.length.should.eql(2); theme.results.recommendation.byFiles['package.json'].length.should.eql(1); - theme.results.error.all.length.should.eql(98); + theme.results.error.all.length.should.eql(97); theme.results.warning.all.length.should.eql(5); theme.results.error.byFiles['assets/my.css'].length.should.eql(3); - theme.results.error.byFiles['default.hbs'].length.should.eql(17); + theme.results.error.byFiles['default.hbs'].length.should.eql(16); theme.results.error.byFiles['post.hbs'].length.should.eql(54); theme.results.error.byFiles['partials/mypartial.hbs'].length.should.eql(5); theme.results.error.byFiles['index.hbs'].length.should.eql(9); - theme.results.error.byFiles['error.hbs'].length.should.eql(1); done(); }).catch(done);