Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint releaseDate properly #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/frontmatter-linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ module.exports = class FrontmatterLinter {
},
'release-date': {
type: ['date', 'null'],
required: true,
messages: {
type: 'must be a date formatted YYYY-MM-DD',
},
Expand All @@ -116,7 +115,7 @@ module.exports = class FrontmatterLinter {
},
};

this.defaultSchema = this.withRules(['stage', 'start-date', 'teams', 'prs']);
this.defaultSchema = this.withRules(['stage', 'start-date', 'teams', 'prs', 'release-date']);
this.releasedOrLaterSchema = this.withRules([
'stage',
'start-date',
Expand Down
3 changes: 2 additions & 1 deletion test/frontmatter-linter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const emptyMetadata = `---
const nonExistentStageMarkdown = `---
stage: propsed
start-date: 2020-01-01
release-date: Unreleased
release-date:
release-versions:
ember-source: vX.Y.Z
ember-data: vX.Y.Z
Expand Down Expand Up @@ -155,6 +155,7 @@ describe('FrontmatterLinter', function () {
'prs.accepted must be the URL for the original pull request on emberjs/rfcs, for example: https://github.com/emberjs/rfcs/pull/123',
'start-date must be a date formatted YYYY-MM-DD',
'teams must be a list of one or more Ember teams',
'release-date must be a date formatted YYYY-MM-DD',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct though? On an early stage, do we want submitters of RFCs to see the message 'release-date must be a date formatted YYYY-MM-DD'? Because that is what this test is saying.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also noticing, pretty sure the messages are incorrect if we're now requiring iso dates.

]);
});

Expand Down