Skip to content

Commit fcb1341

Browse files
committed
test: remove wrong node type
1 parent cda6a80 commit fcb1341

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

src/linter/constants.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const LLM_DESCRIPTION_REGEX = /<!--\s?llm_description=.*-->/;
66

77
export const LINT_MESSAGES = {
88
missingIntroducedIn: "Missing 'introduced_in' field in the API doc entry",
9-
invalidChangeProperty: 'Invalid change property type: {{type}}',
9+
invalidChangeProperty: 'Invalid change property type',
1010
missingChangeVersion: 'Missing version field in the API doc entry',
1111
invalidChangeVersion: 'Invalid version number: {{version}}',
1212
duplicateStabilityNode: 'Duplicate stability node',

src/linter/rules/__tests__/invalid-change-version.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ describe('invalidChangeVersion', () => {
272272
deepStrictEqual(call.arguments, [
273273
{
274274
level: 'error',
275-
message: 'Invalid change property type: PLAIN',
275+
message: 'Invalid change property type',
276276
position: {
277277
start: { line: 8 },
278278
end: { line: 8 },
@@ -314,7 +314,7 @@ describe('invalidChangeVersion', () => {
314314
deepStrictEqual(call.arguments, [
315315
{
316316
level: 'error',
317-
message: 'Invalid change property type: PLAIN',
317+
message: 'Invalid change property type',
318318
position: {
319319
start: { line: 8 },
320320
end: { line: 8 },

src/linter/rules/invalid-change-version.mjs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,7 @@ const isInvalid = NODE_RELEASED_VERSIONS
7171
*/
7272
export const extractVersions = ({ context, node, createYamlIssue }) => {
7373
if (!isMap(node)) {
74-
context.report(
75-
createYamlIssue(
76-
LINT_MESSAGES.invalidChangeProperty.replace('{{type}}', node.type),
77-
node
78-
)
79-
);
74+
context.report(createYamlIssue(LINT_MESSAGES.invalidChangeProperty, node));
8075

8176
return [];
8277
}
@@ -124,13 +119,7 @@ export const invalidChangeVersion = context => {
124119
// Validate changes node is a sequence
125120
if (!isSeq(changesNode.value)) {
126121
return context.report(
127-
createYamlIssue(
128-
LINT_MESSAGES.invalidChangeProperty.replace(
129-
'{{type}}',
130-
changesNode.value.type
131-
),
132-
changesNode.key
133-
)
122+
createYamlIssue(LINT_MESSAGES.invalidChangeProperty, changesNode.key)
134123
);
135124
}
136125

0 commit comments

Comments
 (0)