{"record":{"id":"34190380e42308a6","repo":"nodejs/node","slug":"malformed-line-s","errorCode":null,"errorMessage":"Malformed line: '%s'.","messagePattern":"Malformed line: '(.+?)'\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tools/test.py","lineNumber":1376,"sourceCode":"      value_str = rule_match.group(2).strip()\n      value = ParseCondition(value_str)\n      if not value:\n        return False\n      current_section.AddRule(Rule(rule_match.group(1), path, value))\n      continue\n    def_match = DEF_PATTERN.match(line)\n    if def_match:\n      name = def_match.group(1).lower()\n      value = ParseCondition(def_match.group(2).strip())\n      if not value:\n        return False\n      defs[name] = value\n      continue\n    prefix_match = PREFIX_PATTERN.match(line)\n    if prefix_match:\n      prefix = SplitPath(prefix_match.group(1).strip())\n      continue\n    raise Exception(\"Malformed line: '%s'.\" % line)\n\n\n# ---------------\n# --- M a i n ---\n# ---------------\n\n\nARCH_GUESS = utils.GuessArchitecture()\n\n\ndef BuildOptions():\n  result = argparse.ArgumentParser()\n  result.add_argument(\"-m\", \"--mode\", help=\"The test modes in which to run (comma-separated)\",\n      default='release')\n  result.add_argument(\"-v\", \"--verbose\", help=\"Verbose output\",\n      default=False, action=\"store_true\")\n  result.add_argument('--logfile', dest='logfile',\n      help='write test output to file. NOTE: this only applies the tap progress indicator')","sourceCodeStart":1358,"sourceCodeEnd":1394,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/test.py#L1358-L1394","documentation":"The test runner parses status files (the .status files that express expected results/conditions per test path). Each meaningful line must match either a definition pattern (key = condition) or a path-prefix pattern; any line matching neither is rejected as malformed.","triggerScenarios":"A syntax error in a .status file: a stray token, a malformed condition, a missing '=', or a prefix line in the wrong shape.","commonSituations":"Hand-editing a .status file; unresolved git merge-conflict markers left in it; a BOM or CRLF/CRLF-only encoding issue; copy-paste introducing invisible characters.","solutions":["Open the file named in the error and fix the offending line to match the status-file grammar (key = condition, or a valid path prefix).","Remove any `<<<<<<<`/`=======`/`>>>>>>>` merge-conflict markers.","Re-save the file as UTF-8 without BOM and LF line endings."],"exampleFix":"// before (in test/parallel/.status)\n  parallel/test-foo PASS,FLAKY       # malformed: missing '=' grammar\n// after\n  parallel/test-foo: PASS,FLAKY      # use the documented prefix/condition form","handlingStrategy":"validation","validationCode":"# cheap pre-check: every non-comment, non-blank line matches DEF or PREFIX\nimport re\nok = re.compile(r'^\\s*(#.*)?$')\nassert all(ok.match(l) or DEF_PATTERN.match(l) or PREFIX_PATTERN.match(l)\n           for l in open(status_file)), f'{status_file} has a malformed line'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow the status-file grammar when editing .status files.","Lint status files in CI to catch merge artifacts and bad lines early."],"tags":["testing","status-file","configuration","node"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}