[{"data":1,"prerenderedAt":1554,"buildId":1555},["ShallowReactive",2],{"docs:\u002Fguide\u002Frenderers":3},{"page":4,"section":16,"document":17,"credits":10,"prev":1548,"next":1552},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"renderers","\u002Fguide\u002Frenderers","guide\u002Frenderers.md","Custom renderers","Replace one format's output with renderers or every format's with render, using the Renderer interface, RunState, RenderContext and the head and tail parts.",null,[],"i-lucide-paintbrush","article",true,13,"guide",{"nodes":18,"toc":1539},[19,23,31,38,65,77,412,419,435,453,459,622,641,656,661,666,859,865,940,946,956,992,1004,1010,1022,1031,1388,1405,1444,1454,1460,1475,1499,1532],[20,21,22],"p",{},"A renderer turns what your command collected into the text a reader gets. readerly ships one for each built-in format, and you can replace any of them when your tool already has an output other programs depend on.",[24,25,30],"h2",{"id":26,"anchor":27},"renderers-or-render",{"label":28,"icon":29},"Section titled \"renderers or render\"","#","renderers or render",[20,32,33,37],{},[34,35,36],"code",{},"createOut"," takes two options for this:",[39,40,41,55],"ul",{},[42,43,44,46,47,50,51,54],"li",{},[34,45,5],{}," replaces the renderer of the formats you name, such as ",[34,48,49],{},"{ json, text }",", and keeps the built-in ones for the rest. Combined with ",[34,52,53],{},"formats",", it adds new formats.",[42,56,57,60,61,64],{},[34,58,59],{},"render"," replaces every format with one function. It gets ",[34,62,63],{},"ctx.profile.format"," and decides for itself.",[20,66,67,68,70,71,73,74],{},"When you pass both, ",[34,69,59],{}," wins. When the picked format has no renderer, ",[34,72,36],{}," throws ",[34,75,76],{},"No renderer for format \u003Cname>.",[78,79,83],"pre",{"language":80,"filename":81,"class":82,"wrap":14},"ts","check.ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[34,84,86,115,116,115,118,115,140,115,155,115,202,115,230,115,241,115,309,115,317,115,322,115,367,115,372,115,377,115,379],{"class":85},"language-ts",[87,88,91,95,99,102,105,108,112],"span",{"class":89,"style":90},"line","display: inline",[87,92,94],{"style":93},"color:#CF222E;--shiki-dark:#FF7B72","import",[87,96,98],{"style":97},"color:#1F2328;--shiki-dark:#E6EDF3"," { createOut, ",[87,100,101],{"style":93},"type",[87,103,104],{"style":97}," Renderer } ",[87,106,107],{"style":93},"from",[87,109,111],{"style":110},"color:#0A3069;--shiki-dark:#A5D6FF"," \"readerly\"",[87,113,114],{"style":97},";","\n",[87,117],{"class":89,"style":90},[87,119,120,123,127,130,134,137],{"class":89,"style":90},[87,121,122],{"style":93},"const",[87,124,126],{"style":125},"color:#0550AE;--shiki-dark:#79C0FF"," grep",[87,128,129],{"style":93},":",[87,131,133],{"style":132},"color:#953800;--shiki-dark:#FFA657"," Renderer",[87,135,136],{"style":93}," =",[87,138,139],{"style":97}," {",[87,141,142,146,149,152],{"class":89,"style":90},[87,143,145],{"style":144},"color:#8250DF;--shiki-dark:#D2A8FF","  render",[87,147,148],{"style":97},"(",[87,150,151],{"style":132},"run",[87,153,154],{"style":97},") {",[87,156,157,160,163,166,169,172,174,177,180,182,185,187,190,193,196,199],{"class":89,"style":90},[87,158,159],{"style":93},"    if",[87,161,162],{"style":97}," (run.failure) ",[87,164,165],{"style":93},"return",[87,167,168],{"style":97}," { stderr: ",[87,170,171],{"style":110},"`error: ${",[87,173,151],{"style":97},[87,175,176],{"style":110},".",[87,178,179],{"style":97},"failure",[87,181,176],{"style":110},[87,183,184],{"style":97},"error",[87,186,176],{"style":110},[87,188,189],{"style":97},"message",[87,191,192],{"style":110},"}",[87,194,195],{"style":93},"\\n",[87,197,198],{"style":110},"`",[87,200,201],{"style":97}," };",[87,203,204,207,210,212,215,218,221,224,227],{"class":89,"style":90},[87,205,206],{"style":93},"    const",[87,208,209],{"style":125}," rows",[87,211,136],{"style":93},[87,213,214],{"style":97}," run.entries.",[87,216,217],{"style":144},"flatMap",[87,219,220],{"style":97},"((",[87,222,223],{"style":132},"entry",[87,225,226],{"style":97},") ",[87,228,229],{"style":93},"=>",[87,231,232,235,238],{"class":89,"style":90},[87,233,234],{"style":97},"      entry.type ",[87,236,237],{"style":93},"===",[87,239,240],{"style":110}," \"diagnostic\"",[87,242,243,246,249,252,254,256,259,261,264,267,269,271,273,275,278,281,283,285,287,289,291,293,295,297,299,301,303,306],{"class":89,"style":90},[87,244,245],{"style":93},"        ?",[87,247,248],{"style":97}," [",[87,250,251],{"style":110},"`${",[87,253,223],{"style":97},[87,255,176],{"style":110},[87,257,258],{"style":97},"diagnostic",[87,260,176],{"style":110},[87,262,263],{"style":97},"file",[87,265,266],{"style":110},"}: ${",[87,268,223],{"style":97},[87,270,176],{"style":110},[87,272,258],{"style":97},[87,274,176],{"style":110},[87,276,277],{"style":97},"severity",[87,279,280],{"style":110},"} ${",[87,282,223],{"style":97},[87,284,176],{"style":110},[87,286,258],{"style":97},[87,288,176],{"style":110},[87,290,34],{"style":97},[87,292,280],{"style":110},[87,294,223],{"style":97},[87,296,176],{"style":110},[87,298,258],{"style":97},[87,300,176],{"style":110},[87,302,189],{"style":97},[87,304,305],{"style":110},"}`",[87,307,308],{"style":97},"]",[87,310,311,314],{"class":89,"style":90},[87,312,313],{"style":93},"        :",[87,315,316],{"style":97}," [],",[87,318,319],{"class":89,"style":90},[87,320,321],{"style":97},"    );",[87,323,324,327,330,333,335,338,340,342,345,347,349,351,353,356,359,361,364],{"class":89,"style":90},[87,325,326],{"style":93},"    return",[87,328,329],{"style":97}," { stdout: rows.",[87,331,332],{"style":144},"map",[87,334,220],{"style":97},[87,336,337],{"style":132},"row",[87,339,226],{"style":97},[87,341,229],{"style":93},[87,343,344],{"style":110}," `${",[87,346,337],{"style":97},[87,348,192],{"style":110},[87,350,195],{"style":93},[87,352,198],{"style":110},[87,354,355],{"style":97},").",[87,357,358],{"style":144},"join",[87,360,148],{"style":97},[87,362,363],{"style":110},"\"\"",[87,365,366],{"style":97},") };",[87,368,369],{"class":89,"style":90},[87,370,371],{"style":97},"  },",[87,373,374],{"class":89,"style":90},[87,375,376],{"style":97},"};",[87,378],{"class":89,"style":90},[87,380,381,383,386,388,391,394,397,400,403,406,409],{"class":89,"style":90},[87,382,122],{"style":93},[87,384,385],{"style":125}," out",[87,387,136],{"style":93},[87,389,390],{"style":144}," createOut",[87,392,393],{"style":97},"({ tool: ",[87,395,396],{"style":110},"\"acme\"",[87,398,399],{"style":97},", command: ",[87,401,402],{"style":110},"\"check\"",[87,404,405],{"style":97},", argv, formats: [",[87,407,408],{"style":110},"\"grep\"",[87,410,411],{"style":97},"], renderers: { grep } });",[20,413,414,415,418],{},"With two diagnostics, ",[34,416,417],{},"acme check --format grep"," prints:",[78,420,422],{"language":421,"class":82,"wrap":14},"text",[34,423,425,115,430],{"class":424},"language-text",[87,426,427],{"class":89,"style":90},[87,428,429],{},"src\u002Fapp.ts: error ACME001 Route handler reads process.env at module scope",[87,431,432],{"class":89,"style":90},[87,433,434],{},"vite.config.ts: warn ACME010 Alias shadows a workspace package",[20,436,437,440,441,444,445,448,449,452],{},[34,438,439],{},"--format grep"," and ",[34,442,443],{},"ACME_FORMAT=grep"," now work, and a bad ",[34,446,447],{},"--format"," lists ",[34,450,451],{},"grep"," with the built-in four. readerly still owns the exit code, the rerun command and the reader flags.",[24,454,458],{"id":455,"anchor":456},"the-renderer-interface",{"label":457,"icon":29},"Section titled \"The Renderer interface\"","The Renderer interface",[78,460,462],{"language":80,"filename":461,"class":82,"wrap":14},"types.ts",[34,463,464,115,474,115,487,115,498,115,502,115,504,115,529,115,586,115,618],{"class":85},[87,465,466,469,472],{"class":89,"style":90},[87,467,468],{"style":93},"interface",[87,470,471],{"style":132}," Chunk",[87,473,139],{"style":97},[87,475,476,479,482,485],{"class":89,"style":90},[87,477,478],{"style":132},"  stdout",[87,480,481],{"style":93},"?:",[87,483,484],{"style":125}," string",[87,486,114],{"style":97},[87,488,489,492,494,496],{"class":89,"style":90},[87,490,491],{"style":132},"  stderr",[87,493,481],{"style":93},[87,495,484],{"style":125},[87,497,114],{"style":97},[87,499,500],{"class":89,"style":90},[87,501,192],{"style":97},[87,503],{"class":89,"style":90},[87,505,506,508,510,513,516,519,522,524,526],{"class":89,"style":90},[87,507,468],{"style":93},[87,509,133],{"style":132},[87,511,512],{"style":97},"\u003C",[87,514,515],{"style":132},"Result",[87,517,518],{"style":93}," extends",[87,520,521],{"style":125}," object",[87,523,136],{"style":93},[87,525,521],{"style":125},[87,527,528],{"style":97},"> {",[87,530,531,534,537,539,541,543,546,549,551,553,556,558,560,563,566,568,571,574,576,578,581,584],{"class":89,"style":90},[87,532,533],{"style":144},"  entry",[87,535,536],{"style":93},"?",[87,538,148],{"style":97},[87,540,223],{"style":132},[87,542,129],{"style":93},[87,544,545],{"style":132}," Entry",[87,547,548],{"style":97},", ",[87,550,151],{"style":132},[87,552,129],{"style":93},[87,554,555],{"style":132}," RunState",[87,557,512],{"style":97},[87,559,515],{"style":132},[87,561,562],{"style":97},">, ",[87,564,565],{"style":132},"ctx",[87,567,129],{"style":93},[87,569,570],{"style":132}," RenderContext",[87,572,573],{"style":97},")",[87,575,129],{"style":93},[87,577,471],{"style":132},[87,579,580],{"style":93}," |",[87,582,583],{"style":125}," undefined",[87,585,114],{"style":97},[87,587,588,590,592,594,596,598,600,602,604,606,608,610,612,614,616],{"class":89,"style":90},[87,589,145],{"style":144},[87,591,148],{"style":97},[87,593,151],{"style":132},[87,595,129],{"style":93},[87,597,555],{"style":132},[87,599,512],{"style":97},[87,601,515],{"style":132},[87,603,562],{"style":97},[87,605,565],{"style":132},[87,607,129],{"style":93},[87,609,570],{"style":132},[87,611,573],{"style":97},[87,613,129],{"style":93},[87,615,471],{"style":132},[87,617,114],{"style":97},[87,619,620],{"class":89,"style":90},[87,621,192],{"style":97},[20,623,624,626,627,629,630,633,634,637,638,640],{},[34,625,223],{}," runs once per entry as you add it, for output that streams. The built-in ",[34,628,421],{}," renderer uses it to print logs as they happen, and ",[34,631,632],{},"jsonl"," to print each record. Return ",[34,635,636],{},"undefined"," to print nothing yet. ",[34,639,59],{}," runs when the command ends and before prompts, and returns everything else.",[20,642,643,644,647,648,651,652,655],{},"A renderer returns strings and never writes. readerly writes the chunk's ",[34,645,646],{},"stdout"," first, then its ",[34,649,650],{},"stderr",". Because renderers are pure functions of their input, you can test one by calling it with a ",[34,653,654],{},"RunState"," you build by hand.",[24,657,654],{"id":658,"anchor":659},"runstate",{"label":660,"icon":29},"Section titled \"RunState\"",[20,662,663,665],{},[34,664,654],{}," is what the command collected:",[667,668,669,682],"table",{},[670,671,672],"thead",{},[673,674,675,679],"tr",{},[676,677,678],"th",{},"Field",[676,680,681],{},"What it holds",[683,684,685,704,717,730,740,753,770,789,805,818,831,849],"tbody",{},[673,686,687,699],{},[688,689,690,548,693,548,696],"td",{},[34,691,692],{},"tool",[34,694,695],{},"command",[34,697,698],{},"version",[688,700,701,702,176],{},"From ",[34,703,36],{},[673,705,706,711],{},[688,707,708],{},[34,709,710],{},"schema",[688,712,713,716],{},[34,714,715],{},"\u003Ctool>.\u003Ccommand>\u002Fv1",", unless the tool sets one.",[673,718,719,724],{},[688,720,721],{},[34,722,723],{},"rerun",[688,725,726,727,176],{},"The invocation without reader flags, shell-quoted, such as ",[34,728,729],{},"acme check src 'my dir'",[673,731,732,737],{},[688,733,734],{},[34,735,736],{},"entries",[688,738,739],{},"Diagnostics, logs and next steps, in the order you added them.",[673,741,742,747],{},[688,743,744],{},[34,745,746],{},"counts",[688,748,749,752],{},[34,750,751],{},"{ error, warn, info }"," across every diagnostic.",[673,754,755,760],{},[688,756,757],{},[34,758,759],{},"result",[688,761,762,763,766,767,176],{},"What ",[34,764,765],{},"out.set()"," merged, as ",[34,768,769],{},"Partial\u003CResult>",[673,771,772,777],{},[688,773,774],{},[34,775,776],{},"status",[688,778,779,548,782,785,786,176],{},[34,780,781],{},"ok",[34,783,784],{},"failed"," or ",[34,787,788],{},"action_required",[673,790,791,796],{},[688,792,793],{},[34,794,795],{},"summary",[688,797,798,799,801,802,176],{},"The words after the counts, from the ",[34,800,795],{}," option or ",[34,803,804],{},"out.end()",[673,806,807,811],{},[688,808,809],{},[34,810,179],{},[688,812,813,814,817],{},"Set by ",[34,815,816],{},"out.fail()"," and by a bad reader flag.",[673,819,820,825],{},[688,821,822],{},[34,823,824],{},"answer",[688,826,762,827,830],{},[34,828,829],{},"out.write()"," set.",[673,832,833,838],{},[688,834,835],{},[34,836,837],{},"part",[688,839,840,548,843,785,846,176],{},[34,841,842],{},"whole",[34,844,845],{},"head",[34,847,848],{},"tail",[673,850,851,856],{},[688,852,853],{},[34,854,855],{},"before",[688,857,858],{},"The counts, status and summary the last part showed.",[24,860,864],{"id":861,"anchor":862},"rendercontext",{"label":863,"icon":29},"Section titled \"RenderContext\"","RenderContext",[667,866,867,875],{},[670,868,869],{},[673,870,871,873],{},[676,872,678],{},[676,874,681],{},[683,876,877,899,917],{},[673,878,879,884],{},[688,880,881],{},[34,882,883],{},"profile",[688,885,886,887,894,895,898],{},"The reader's ",[888,889,891],"a",{"href":890},"\u002Fguide\u002Fapi#types",[34,892,893],{},"Profile",": format, color, budget, ",[34,896,897],{},"full",", verbosity and the detection.",[673,900,901,906],{},[688,902,903],{},[34,904,905],{},"style",[688,907,908,909,912,913,916],{},"A ",[34,910,911],{},"Style"," function that colors text when ",[34,914,915],{},"profile.color"," is on and returns it unchanged otherwise.",[673,918,919,924],{},[688,920,921],{},[34,922,923],{},"maxRows",[688,925,926,927,929,930,932,933,936,937,176],{},"The ",[34,928,923],{}," option on a terminal reader with ",[34,931,421],{},". ",[34,934,935],{},"Infinity"," in CI, pipes and with ",[34,938,939],{},"--full",[24,941,945],{"id":942,"anchor":943},"parts-around-prompts",{"label":944,"icon":29},"Section titled \"Parts around prompts\"","Parts around prompts",[20,947,948,949,951,952,955],{},"A command that never prompts gets one call to ",[34,950,59],{}," with ",[34,953,954],{},"part: \"whole\"",". A prompt changes that, because findings have to print above the question:",[957,958,959,969,987],"ol",{},[42,960,961,962,964,965,968],{},"Before the first prompt, ",[34,963,59],{}," gets ",[34,966,967],{},"part: \"head\""," with everything so far.",[42,970,971,972,974,975,932,978,980,981,983,984,986],{},"Before each later prompt that has something new, and at ",[34,973,804],{},", it gets ",[34,976,977],{},"part: \"tail\"",[34,979,736],{}," holds only what came since the last part, and ",[34,982,746],{}," still covers every diagnostic. ",[34,985,824],{}," is there only when it was written since the last part.",[42,988,989,991],{},[34,990,855],{}," holds what the last part showed, so a tail can repeat the verdict only when it changed.",[20,993,994,995,997,998,1001,1002,176],{},"The built-in ",[34,996,421],{}," renderer prints the verdict in the head and starts each tail section with a blank line. A renderer that writes one document, such as ",[34,999,1000],{},"json",", never sees a head, because prompts only run on ",[34,1003,421],{},[24,1005,1009],{"id":1006,"anchor":1007},"real-tools-through-renderers",{"label":1008,"icon":29},"Section titled \"Real tools through renderers\"","Real tools through renderers",[20,1011,1012,1018,1019,1021],{},[888,1013,1015],{"href":1014},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden-tools.test.ts",[34,1016,1017],{},"test\u002Fgolden-tools.test.ts"," runs fleet's and glosslint's output through ",[34,1020,36],{}," and compares it byte for byte with their own tests.",[20,1023,1024,1025,1028,1029,129],{},"fleet keeps its ",[34,1026,1027],{},"--json"," document and moves human lines to stderr under ",[34,1030,1027],{},[78,1032,1034],{"language":80,"filename":1033,"class":82,"wrap":14},"fleet.ts",[34,1035,1036,115,1051,115,1101,115,1113,115,1118,115,1125,115,1176,115,1206,115,1211,115,1254,115,1258,115,1273,115,1317,115,1365,115,1369,115,1371],{"class":85},[87,1037,1038,1040,1043,1045,1047,1049],{"class":89,"style":90},[87,1039,122],{"style":93},[87,1041,1042],{"style":125}," json",[87,1044,129],{"style":93},[87,1046,133],{"style":132},[87,1048,136],{"style":93},[87,1050,139],{"style":97},[87,1052,1053,1055,1058,1060,1062,1064,1067,1069,1072,1075,1077,1079,1081,1083,1085,1087,1089,1091,1094,1096,1098],{"class":89,"style":90},[87,1054,533],{"style":144},[87,1056,1057],{"style":97},": (",[87,1059,223],{"style":132},[87,1061,226],{"style":97},[87,1063,229],{"style":93},[87,1065,1066],{"style":97}," (entry.type ",[87,1068,237],{"style":93},[87,1070,1071],{"style":110}," \"log\"",[87,1073,1074],{"style":93}," ?",[87,1076,168],{"style":97},[87,1078,251],{"style":110},[87,1080,223],{"style":97},[87,1082,176],{"style":110},[87,1084,189],{"style":97},[87,1086,192],{"style":110},[87,1088,195],{"style":93},[87,1090,198],{"style":110},[87,1092,1093],{"style":97}," } ",[87,1095,129],{"style":93},[87,1097,583],{"style":125},[87,1099,1100],{"style":97},"),",[87,1102,1103,1105,1107,1109,1111],{"class":89,"style":90},[87,1104,145],{"style":144},[87,1106,1057],{"style":97},[87,1108,151],{"style":132},[87,1110,226],{"style":97},[87,1112,229],{"style":93},[87,1114,1115],{"class":89,"style":90},[87,1116,1117],{"style":97},"    run.failure",[87,1119,1120,1123],{"class":89,"style":90},[87,1121,1122],{"style":93},"      ?",[87,1124,139],{"style":97},[87,1126,1127,1130,1132,1135,1137,1140,1143,1146,1149,1151,1154,1157,1160,1162,1165,1167,1169,1171,1173],{"class":89,"style":90},[87,1128,1129],{"style":97},"          stdout: ",[87,1131,251],{"style":110},[87,1133,1134],{"style":125},"JSON",[87,1136,176],{"style":110},[87,1138,1139],{"style":144},"stringify",[87,1141,1142],{"style":110},"({ ",[87,1144,1145],{"style":97},"ok: ",[87,1147,1148],{"style":125},"false",[87,1150,548],{"style":110},[87,1152,1153],{"style":97},"error: run.failure.error.message ",[87,1155,1156],{"style":110},"}, ",[87,1158,1159],{"style":125},"null",[87,1161,548],{"style":110},[87,1163,1164],{"style":125},"2",[87,1166,573],{"style":110},[87,1168,192],{"style":110},[87,1170,195],{"style":93},[87,1172,198],{"style":110},[87,1174,1175],{"style":97},",",[87,1177,1178,1181,1184,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204],{"class":89,"style":90},[87,1179,1180],{"style":97},"          stderr: ",[87,1182,1183],{"style":110},"`fleetrc: ${",[87,1185,151],{"style":97},[87,1187,176],{"style":110},[87,1189,179],{"style":97},[87,1191,176],{"style":110},[87,1193,184],{"style":97},[87,1195,176],{"style":110},[87,1197,189],{"style":97},[87,1199,192],{"style":110},[87,1201,195],{"style":93},[87,1203,198],{"style":110},[87,1205,1175],{"style":97},[87,1207,1208],{"class":89,"style":90},[87,1209,1210],{"style":97},"        }",[87,1212,1213,1216,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237,1239,1241,1243,1245,1247,1249,1251],{"class":89,"style":90},[87,1214,1215],{"style":93},"      :",[87,1217,1218],{"style":97}," { stdout: ",[87,1220,251],{"style":110},[87,1222,1134],{"style":125},[87,1224,176],{"style":110},[87,1226,1139],{"style":144},[87,1228,148],{"style":110},[87,1230,151],{"style":97},[87,1232,176],{"style":110},[87,1234,759],{"style":97},[87,1236,548],{"style":110},[87,1238,1159],{"style":125},[87,1240,548],{"style":110},[87,1242,1164],{"style":125},[87,1244,573],{"style":110},[87,1246,192],{"style":110},[87,1248,195],{"style":93},[87,1250,198],{"style":110},[87,1252,1253],{"style":97}," },",[87,1255,1256],{"class":89,"style":90},[87,1257,376],{"style":97},[87,1259,1260,1262,1265,1267,1269,1271],{"class":89,"style":90},[87,1261,122],{"style":93},[87,1263,1264],{"style":125}," text",[87,1266,129],{"style":93},[87,1268,133],{"style":132},[87,1270,136],{"style":93},[87,1272,139],{"style":97},[87,1274,1275,1277,1279,1281,1283,1285,1287,1289,1291,1293,1295,1297,1299,1301,1303,1305,1307,1309,1311,1313,1315],{"class":89,"style":90},[87,1276,533],{"style":144},[87,1278,1057],{"style":97},[87,1280,223],{"style":132},[87,1282,226],{"style":97},[87,1284,229],{"style":93},[87,1286,1066],{"style":97},[87,1288,237],{"style":93},[87,1290,1071],{"style":110},[87,1292,1074],{"style":93},[87,1294,1218],{"style":97},[87,1296,251],{"style":110},[87,1298,223],{"style":97},[87,1300,176],{"style":110},[87,1302,189],{"style":97},[87,1304,192],{"style":110},[87,1306,195],{"style":93},[87,1308,198],{"style":110},[87,1310,1093],{"style":97},[87,1312,129],{"style":93},[87,1314,583],{"style":125},[87,1316,1100],{"style":97},[87,1318,1319,1321,1323,1325,1327,1329,1332,1334,1336,1338,1340,1342,1344,1346,1348,1350,1352,1354,1356,1358,1360,1362],{"class":89,"style":90},[87,1320,145],{"style":144},[87,1322,1057],{"style":97},[87,1324,151],{"style":132},[87,1326,226],{"style":97},[87,1328,229],{"style":93},[87,1330,1331],{"style":97}," (run.failure ",[87,1333,536],{"style":93},[87,1335,168],{"style":97},[87,1337,1183],{"style":110},[87,1339,151],{"style":97},[87,1341,176],{"style":110},[87,1343,179],{"style":97},[87,1345,176],{"style":110},[87,1347,184],{"style":97},[87,1349,176],{"style":110},[87,1351,189],{"style":97},[87,1353,192],{"style":110},[87,1355,195],{"style":93},[87,1357,198],{"style":110},[87,1359,1093],{"style":97},[87,1361,129],{"style":93},[87,1363,1364],{"style":97}," {}),",[87,1366,1367],{"class":89,"style":90},[87,1368,376],{"style":97},[87,1370],{"class":89,"style":90},[87,1372,1373,1375,1377,1380,1382,1385],{"class":89,"style":90},[87,1374,36],{"style":144},[87,1376,393],{"style":97},[87,1378,1379],{"style":110},"\"fleetrc\"",[87,1381,399],{"style":97},[87,1383,1384],{"style":110},"\"list\"",[87,1386,1387],{"style":97},", argv, renderers: { json, text } });",[20,1389,1390,1391,1393,1394,1400,1401,1404],{},"glosslint replaces ",[34,1392,421],{}," with a ",[888,1395,1397],{"href":1396},"\u002Fguide\u002Fdiagnostics#using-tree-on-its-own",[34,1398,1399],{},"tree()"," per finding and its own summary line, and ends with ",[34,1402,1403],{},"out.end({ status: \"failed\" })"," because it exits 1 on warnings too. One finding and the summary line, as glosslint prints them:",[78,1406,1407],{"language":421,"class":82,"wrap":14},[34,1408,1409,115,1414,115,1419,115,1424,115,1429,115,1434,115,1439],{"class":424},[87,1410,1411],{"class":89,"style":90},[87,1412,1413],{},"[GLOSSLINT_AVOID] \"rack\" in docs\u002Friding.md:7:51",[87,1415,1416],{"class":89,"style":90},[87,1417,1418],{},"├▶ why: Racks are unpowered.",[87,1420,1421],{"class":89,"style":90},[87,1422,1423],{},"├▶ fix: Use \"dock\": \"Unlock a bike at any station. Return it to a free dock when you\"",[87,1425,1426],{"class":89,"style":90},[87,1427,1428],{},"├▶ term: Dock, a powered stand where one bike is locked.",[87,1430,1431],{"class":89,"style":90},[87,1432,1433],{},"╰▶ see: https:\u002F\u002Fexample.com\u002Fdocs\u002Fdocks",[87,1435,1436],{"class":89,"style":90},[87,1437,1438],{},"",[87,1440,1441],{"class":89,"style":90},[87,1442,1443],{},"5 findings in 3 of 4 files.",[20,1445,926,1446,1449,1450,1453],{},[34,1447,1448],{},"term:"," branch comes from the diagnostic's ",[34,1451,1452],{},"data",", which the built-in renderers don't print.",[24,1455,1459],{"id":1456,"anchor":1457},"answers-the-tool-renders",{"label":1458,"icon":29},"Section titled \"Answers the tool renders\"","Answers the tool renders",[20,1461,1462,1463,1466,1467,1470,1471,1474],{},"Some commands answer with text, such as an explanation or a Markdown page, instead of findings. ",[34,1464,1465],{},"out.write(answer)"," hands it to the built-in renderers, which place it for each reader. With ",[34,1468,1469],{},"out.write(\"ACME001 reads process.env at module scope.\\nMove the read into the handler.\")"," and one ",[34,1472,1473],{},"next",", a coding agent gets:",[78,1476,1477],{"language":421,"class":82,"wrap":14},[34,1478,1479,115,1484,115,1489,115,1494],{"class":424},[87,1480,1481],{"class":89,"style":90},[87,1482,1483],{},"acme explain: ok. no problems.",[87,1485,1486],{"class":89,"style":90},[87,1487,1488],{},"ACME001 reads process.env at module scope.",[87,1490,1491],{"class":89,"style":90},[87,1492,1493],{},"Move the read into the handler.",[87,1495,1496],{"class":89,"style":90},[87,1497,1498],{},"next: acme explain ACME004   (the next code)",[20,1500,1501,1503,1504,1507,1508,1511,1512,1516,1517,932,1520,440,1522,1524,1525,1527,1528,176],{},[34,1502,421],{}," prints it between the verdict and the ",[34,1505,1506],{},"next:"," lines, separated by blank lines. In ",[34,1509,1510],{},"agent",", the answer replaces the diagnostic and log rows, and under a ",[888,1513,1515],{"href":1514},"\u002Fguide\u002Fbudget","budget"," it is cut at line boundaries with ",[34,1518,1519],{},"hidden: N lines",[34,1521,1000],{},[34,1523,632],{}," carry it as ",[34,1526,824],{},". To render Markdown for the terminal first, see ",[888,1529,1531],{"href":1530},"\u002Fintegrations\u002Fmarkdown-answers","Markdown answers",[20,1533,1534,1535,176],{},"Next: ",[888,1536,1538],{"href":1537},"\u002Fguide\u002Fapi","API",[1540,1542,1543,1544,1545,1546,1547],{"id":26,"depth":1541,"text":30},2,{"id":455,"depth":1541,"text":458},{"id":658,"depth":1541,"text":654},{"id":861,"depth":1541,"text":864},{"id":942,"depth":1541,"text":945},{"id":1006,"depth":1541,"text":1009},{"id":1456,"depth":1541,"text":1459},{"path":1549,"title":1550,"description":1551},"\u002Fguide\u002Fjson","JSON and JSONL","The json document and the jsonl record stream a readerly command prints, their fields and schema name, failures in both, and how out.set fills result.",{"path":1537,"title":1538,"description":1553},"Reference for every readerly entry point: createOut with its options and methods, the lower-level functions by subpath, and the shared types.",1795985393784,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]