Skip to content

Conversation

EnTeQuAk
Copy link
Contributor

@EnTeQuAk EnTeQuAk commented May 29, 2019

In 3888a7d I introduced reserved
filename scanning and forgot to define a description property on the
RESERVED_FILENAME message.

The description is needed to be properly exposable to the JSON and
text exports.

@EnTeQuAk EnTeQuAk force-pushed the fix-missing-description-message branch from e97c116 to ae061f6 Compare May 29, 2019 10:02
Copy link
Contributor

@muffinresearch muffinresearch left a comment

Choose a reason for hiding this comment

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

Looks like the tests are failing quite heavily.

};
}

export const MANIFEST_ICON_NOT_FOUND = 'MANIFEST_ICON_NOT_FOUND';
Copy link
Contributor

@muffinresearch muffinresearch May 29, 2019

Choose a reason for hiding this comment

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

I think these constants are used in tests so they should probably continue to be used.

@muffinresearch
Copy link
Contributor

muffinresearch commented May 29, 2019

A message must always have a description set, this validates this. The validation is a bit helpless for messages that are exposed through a function but for the specific issue - that RESERVED_FILENAME was broken it works.

I'm not sure I completely follow this description - could you clarify what the branch is aiming for?

Ah I think I see it now looking further at the code, this is adding a test for the description which is causing the newly added rule to break.

@EnTeQuAk EnTeQuAk force-pushed the fix-missing-description-message branch from ae061f6 to a06094c Compare May 29, 2019 10:41
@EnTeQuAk EnTeQuAk changed the title Fix detection of missing 'description' not being set properly. Fix RESERVED_FILENAME message construction. May 29, 2019
In 3888a7d I introduced reserved
filename scanning and forgot to define a `description` property on the
`RESERVED_FILENAME` message.

The `description` is needed to be properly exposable to the JSON and
text exports.
@EnTeQuAk EnTeQuAk force-pushed the fix-missing-description-message branch from a06094c to df2e450 Compare May 29, 2019 10:44
@EnTeQuAk
Copy link
Contributor Author

Ah I think I see it now looking further at the code, this is adding a test for the description which is causing the newly added rule to break.

I re-did the PR completely in df2e450 and made the diff a bit more manageable, especially given it's a regression fix only which should be cherry-picked into this weeks release.

Copy link
Contributor

@muffinresearch muffinresearch left a comment

Choose a reason for hiding this comment

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

r+wc and assuming tests are green

expect(linterMessages.length).toEqual(1);
expect(linterMessages[0].code).toEqual(messages.RESERVED_FILENAME.code);
expect(linterMessages[0].message).toEqual('Reserved filename found.');
expect(linterMessages[0].description.startsWith('Files whose names are reserved')).toEqual(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines could directly assert against RESERVED_FILENAME.message and RESERVED_FILENAME.description couldn't they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I actually wouldn't match/notice the undefined description property which is what I'm after here.

Copy link
Contributor

@muffinresearch muffinresearch May 29, 2019

Choose a reason for hiding this comment

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

Ah yes, good point. As and when the general test for descriptions can cover checking for undefined, this could then be updated, but this gets the necessary fix in which is what you're aiming for right now 👍

@EnTeQuAk EnTeQuAk merged commit 8380e0c into master May 29, 2019
@EnTeQuAk EnTeQuAk deleted the fix-missing-description-message branch May 29, 2019 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants