mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 13:39:44 +02:00
fix: Exempt ADR Links fields from the paragraph length rule (no-changelog) (#39384)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
98f012e268
commit
dbc822ba8b
|
|
@ -532,6 +532,36 @@ describe('AdrConventionsRule', () => {
|
|||
).toBe(true);
|
||||
});
|
||||
|
||||
it('allows Links field lines longer than 100 characters', async () => {
|
||||
addTestFile(
|
||||
tmpDir,
|
||||
'docs/adr/ADR-20260828-obtain-trigger-output-before-creating-the-execution.md',
|
||||
validAdr({
|
||||
title: 'Obtain trigger output before creating the execution',
|
||||
date: '2026-08-28',
|
||||
}),
|
||||
);
|
||||
addTestFile(
|
||||
tmpDir,
|
||||
'docs/adr/ADR-20260904-store-the-workflow-revision-that-ran-with-the-execution.md',
|
||||
validAdr({
|
||||
title: 'Store the workflow revision that ran with the execution',
|
||||
date: '2026-09-04',
|
||||
}),
|
||||
);
|
||||
addTestFile(
|
||||
tmpDir,
|
||||
'docs/adr/ADR-20260922-adopt-a-stable-interface.md',
|
||||
validAdr({
|
||||
relatedAdrs:
|
||||
'ADR-20260828-obtain-trigger-output-before-creating-the-execution, ' +
|
||||
'ADR-20260904-store-the-workflow-revision-that-ran-with-the-execution',
|
||||
}),
|
||||
);
|
||||
|
||||
await expect(rule.analyze(context())).resolves.toEqual([]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: 'a missing Links field',
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const MAX_PARAGRAPH_LINE_LENGTH = 100;
|
|||
* - Use full ADR IDs in supersession metadata.
|
||||
* - Add the required RFC, Documentation, and Related ADRs link fields.
|
||||
* - Resolve local ADR references and allow references in external URLs.
|
||||
* - Limit paragraph lines to 100 characters.
|
||||
* - Limit paragraph lines before the Links section to 100 characters.
|
||||
* - Apply structural rules to the root ADR template.
|
||||
*/
|
||||
export class AdrConventionsRule extends BaseRule<CodeHealthContext> {
|
||||
|
|
@ -92,8 +92,12 @@ export class AdrConventionsRule extends BaseRule<CodeHealthContext> {
|
|||
const violations: Violation[] = [];
|
||||
const { filePath, relativePath, fileName } = file;
|
||||
const isTemplate = relativePath === 'docs/ADR_TEMPLATE.md';
|
||||
const headingResult = validateHeadings(file.tokens);
|
||||
// Links fields hold ADR IDs and URLs, not prose. Their length is not limited.
|
||||
const linksLine = headingResult.valid ? headingResult.indexes.at(-1)! : Infinity;
|
||||
|
||||
for (const { line, length } of findLongParagraphLines(file, MAX_PARAGRAPH_LINE_LENGTH)) {
|
||||
if (line > linksLine) continue;
|
||||
violations.push(
|
||||
this.createViolation(
|
||||
filePath,
|
||||
|
|
@ -168,7 +172,6 @@ export class AdrConventionsRule extends BaseRule<CodeHealthContext> {
|
|||
);
|
||||
}
|
||||
|
||||
const headingResult = validateHeadings(file.tokens);
|
||||
if (!headingResult.valid) {
|
||||
violations.push(
|
||||
this.createViolation(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user