{"record":{"id":"c6d3b6553dcc4bab","repo":"santifer/career-ops","slug":"config-profile-yml-cv-sections-lists-only-d","errorCode":null,"errorMessage":"⚠️  config/profile.yml cv.sections lists only \"${displayTitle(order[0])}\". An order needs at least two sections — one name states no relationship, so nothing was changed.","messagePattern":"⚠️  config/profile\\.yml cv\\.sections lists only \"(.+?)\"\\. An order needs at least two sections — one name states no relationship, so nothing was changed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"generate-pdf.mjs","lineNumber":753,"sourceCode":" * too, in the order they should end up in.\n *\n * Runs before validateCvSectionOrder(), so the guard still judges what will\n * actually be printed — this satisfies the guard rather than bypassing it, which\n * is what separates it from --allow-reorder.\n *\n * No `cv.sections` → the input string is returned unchanged.\n *\n * @param {string} html\n * @param {string[]} order - Canonical section keys, e.g. ['skills', 'education'].\n * @returns {string}\n */\nexport function reorderCvSections(html, order) {\n  if (!Array.isArray(order) || order.length === 0) return html;\n  if (order.length < 2) {\n    // Not an error, but not a no-op worth staying quiet about either: one name\n    // states no relationship, so there is nothing to apply and the user would\n    // otherwise be left thinking the setting took effect.\n    console.warn(`⚠️  config/profile.yml cv.sections lists only \"${displayTitle(order[0])}\". An order needs at least two sections — one name states no relationship, so nothing was changed.`);\n    return html;\n  }\n\n  // No early return on an empty block list: a CV whose sections are all\n  // ambiguous produces none, and silently doing nothing is the failure mode\n  // this feature exists to remove. The per-name loop below reports first.\n  const { blocks, ambiguous, unrecognized } = extractSectionBlocks(html);\n\n  const byKey = new Map();\n  for (const block of blocks) {\n    if (!byKey.has(block.key)) byKey.set(block.key, block);\n  }\n\n  const chosen = [];\n  const unresolved = [];\n  const seen = new Set();\n  for (const name of order) {\n    // `name` comes from a config file and is quoted straight into console","sourceCodeStart":735,"sourceCodeEnd":771,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/generate-pdf.mjs#L735-L771","documentation":"reorderCvSections() in generate-pdf.mjs applies a configured section order from config/profile.yml cv.sections. An order with fewer than two names states no relationship between sections, so there is nothing to apply; the function warns (rather than staying silent) and returns the HTML unchanged so the user does not believe the setting took effect.","triggerScenarios":"Setting `cv: sections: [skills]` (single-element array) or any one-entry list in config/profile.yml, then generating a PDF — order.length < 2 triggers the warning and the HTML passes through untouched.","commonSituations":"User starts building the cv.sections setting by listing the one section they care about, intending to add more later; a YAML nesting mistake collapses the list to one entry; copy-paste from an example leaves only the first item.","solutions":["Add a second (or more) section key to cv.sections so an actual ordering relationship exists","If you only wanted to rename or drop one section, remove the cv.sections key entirely — the template order already applies"],"exampleFix":"# before (config/profile.yml)\ncv:\n  sections: [skills]\n\n# after\ncv:\n  sections: [skills, experience, education]","handlingStrategy":"validation","validationCode":"function cvSectionsApply(order) {\n  // mirrors reorderCvSections: absent = fine, present needs >= 2 names\n  return order == null || (Array.isArray(order) && order.length >= 2);\n}","typeGuard":"/** @param {unknown} v */\nfunction isUsableSections(v) {\n  return v == null || (Array.isArray(v) && v.every(x => typeof x === 'string') && v.length >= 2);\n}","tryCatchPattern":null,"preventionTips":["When introducing cv.sections, write the full intended order in one edit, not one section at a time","Lint user config for single-element cv.sections arrays before running generation"],"tags":["cli","config","cv-generation","yaml","warning"],"backgroundTag":"invalid-config-value","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}