Skip to content

Commit 2cad501

Browse files
committed
test(lint): cover Copilot line budgets
1 parent 610a6c0 commit 2cad501

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

‎test/scripts/oxlint-config.test.ts‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,36 @@ describe("oxlint config", () => {
221221
const maxLinesOverrides = (config.overrides ?? []).filter(
222222
(override) => override.rules?.["max-lines"],
223223
);
224+
const scopedBudgets = maxLinesOverrides.filter((override) => override.excludeFiles);
225+
const exactExceptions = maxLinesOverrides.filter((override) => !override.excludeFiles);
224226

225-
expect(maxLinesOverrides).toHaveLength(4);
226-
expect(maxLinesOverrides.map((override) => override.rules?.["max-lines"])).toEqual([
227+
expect(scopedBudgets).toHaveLength(4);
228+
expect(scopedBudgets.map((override) => override.rules?.["max-lines"])).toEqual([
227229
["error", { max: 700, skipBlankLines: true, skipComments: true }],
228230
["error", { max: 700, skipBlankLines: true, skipComments: true }],
229231
["error", { max: 800, skipBlankLines: true, skipComments: true }],
230232
["error", { max: 1000, skipBlankLines: true, skipComments: true }],
231233
]);
232-
for (const override of maxLinesOverrides) {
234+
for (const override of scopedBudgets) {
233235
expect(override.excludeFiles).toContain("**/protocol-gen/**");
234236
expect(override.excludeFiles).toContain("**/*.generated.*");
235237
expect(override.excludeFiles).toContain("ui/src/i18n/locales/**");
236238
expect(override.excludeFiles).toContain("src/wizard/i18n/locales/**");
237239
}
240+
expect(exactExceptions).toEqual([
241+
{
242+
files: ["extensions/copilot/src/event-bridge.ts"],
243+
rules: {
244+
"max-lines": ["error", { max: 950, skipBlankLines: true, skipComments: true }],
245+
},
246+
},
247+
{
248+
files: ["extensions/copilot/src/attempt-transcript-journal.test.ts"],
249+
rules: {
250+
"max-lines": ["error", { max: 1200, skipBlankLines: true, skipComments: true }],
251+
},
252+
},
253+
]);
238254
});
239255

240256
it("enables strict empty object type lint with named single-extends interfaces allowed", () => {

0 commit comments

Comments
 (0)