A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
chore: upgrade biome (#7355)
Myles Scolnickb73b1dd376de
diff --git a/.github/renovate.json5 b/.github/renovate.json5index c76676274a..88a3a57436 100644--- a/.github/renovate.json5+++ b/.github/renovate.json5@@ -62,6 +62,7 @@"!/.*typescript.*/","!/.*openapi-fetch.*/","!/.*react-aria.*/",+ "!/.*biome.*/",// react-hook-form is pinned to 7.54.2"!/.*react-hook-form.*/",// vega-lite is pinned to 6.3.1@@ -120,6 +121,13 @@"matchUpdateTypes": ["minor", "patch", "major"],"matchPackageNames": ["/.*eslint.*/"],"schedule": ["on the 28th day of the month"]+ },+ // Group all biome dependencies+ {+ "groupName": "all biome dependencies",+ "matchUpdateTypes": ["minor", "patch", "major"],+ "matchPackageNames": ["/.*biome.*/"],+ "schedule": ["on the 29th day of the month"]}]}diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex c4772a5e38..3a575decd1 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -40,7 +40,7 @@ repos:- id: ruff-format- repo: https://github.com/biomejs/pre-commit- rev: v2.2.6+ rev: v2.3.8hooks:- id: biome-checkargs: [--diagnostic-level, warn]diff --git a/biome.jsonc b/biome.jsoncindex bd9af23180..59f48a955f 100644--- a/biome.jsonc+++ b/biome.jsonc@@ -140,6 +140,16 @@"attributePosition": "auto"}},+ "css": {+ "parser": {+ "tailwindDirectives": true+ }+ },+ "html": {+ "parser": {+ "interpolation": true+ }+ },"vcs": {"enabled": true,"clientKind": "git",@@ -160,6 +170,16 @@}}}+ },+ {+ "includes": ["packages/openapi/src/*.ts"],+ "linter": {+ "rules": {+ "style": {+ "useNamingConvention": "off"+ }+ }+ }}]}diff --git a/frontend/index.html b/frontend/index.htmlindex 22a552833e..3fbaacbecd 100644--- a/frontend/index.html+++ b/frontend/index.html@@ -23,22 +23,22 @@<script data-marimo="true">function __resizeIframe(obj) {- var scrollbarHeight = 20; // Max between windows, mac, and linux+ const scrollbarHeight = 20; // Max between windows, mac, and linuxfunction setHeight() {// Guard against race condition where iframe isn't readyif (!obj.contentWindow?.document?.documentElement) {return;}- var element = obj.contentWindow.document.documentElement;+ const element = obj.contentWindow.document.documentElement;// If there is no vertical scrollbar, we don't need to resize the iframeif (element.scrollHeight === element.clientHeight) {return;}// Create a new height that includes the scrollbar height if it's visible- var hasHorizontalScrollbar = element.scrollWidth > element.clientWidth;- var newHeight = element.scrollHeight + (hasHorizontalScrollbar ? scrollbarHeight : 0);+ const hasHorizontalScrollbar = element.scrollWidth > element.clientWidth;+ const newHeight = element.scrollHeight + (hasHorizontalScrollbar ? scrollbarHeight : 0);// Only update the height if it's different from the current heightif (obj.style.height !== `${newHeight}px`) {@@ -50,7 +50,7 @@setHeight();// Resize the iframe when the content changes- const resizeObserver = new ResizeObserver((entries) => {+ const resizeObserver = new ResizeObserver((_entries) => {setHeight();});// Only observe if iframe content is readydiff --git a/frontend/islands/__demo__/index.html b/frontend/islands/__demo__/index.htmlindex 794cb1eea6..c6ad26f684 100644--- a/frontend/islands/__demo__/index.html+++ b/frontend/islands/__demo__/index.html@@ -185,7 +185,6 @@ f: \mathbf{R} o \mathbf{R}.</div></div></div>- </div></body></html>diff --git a/frontend/lint/atomWithStorageArgs.grit b/frontend/lint/atomWithStorageArgs.gritindex 6584f7f2ad..94c5448000 100644--- a/frontend/lint/atomWithStorageArgs.grit+++ b/frontend/lint/atomWithStorageArgs.grit@@ -4,9 +4,5 @@ or {`atomWithStorage($arg1, $arg2)`,`atomWithStorage<$_>($arg1, $arg2)`} where {- register_diagnostic(- span=$arg1,- message="atomWithStorage requires at least 3 arguments (key, defaultValue, storage). Provide the storage parameter explicitly.",- severity="error"- )+ register_diagnostic(span=$arg1, message="atomWithStorage requires at least 3 arguments (key, defaultValue, storage). Provide the storage parameter explicitly.", severity="error")}diff --git a/frontend/lint/noCommentedConsole.grit b/frontend/lint/noCommentedConsole.gritindex 2328faff2c..03a350ad5f 100644--- a/frontend/lint/noCommentedConsole.grit+++ b/frontend/lint/noCommentedConsole.grit@@ -2,9 +2,5 @@ language js// Match commented out console statements`// console.$method` where {- register_diagnostic(- span=.,- message="Remove commented out console statement instead of leaving it in the code",- severity="error"- )+ register_diagnostic(span=., message="Remove commented out console statement instead of leaving it in the code", severity="error")}diff --git a/frontend/package.json b/frontend/package.jsonindex 73a4039dc3..e5cc0bf66d 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -205,7 +205,7 @@"devDependencies": {"@babel/plugin-proposal-decorators": "^7.27.1","@babel/preset-typescript": "^7.25.9",- "@biomejs/biome": "2.2.2",+ "@biomejs/biome": "2.3.8","@codecov/vite-plugin": "^1.9.1","@csstools/postcss-light-dark-function": "^2.0.10","@playwright/test": "^1.56.1",diff --git a/frontend/src/__tests__/main.test.tsx b/frontend/src/__tests__/main.test.tsxindex efcd78721e..3ab2bf2869 100644--- a/frontend/src/__tests__/main.test.tsx+++ b/frontend/src/__tests__/main.test.tsx@@ -45,18 +45,20 @@ describe("main", () => {store.set(configOverridesAtom, {});});- it.each(["edit", "read", "home", "run"])(- "should mount with mode %s",- (_mode) => {- const el = document.createElement("div");- mount({ mode: "edit" }, el);-- expect(store.get(viewStateAtom).mode).toBe("edit");- expect(store.get(filenameAtom)).toBeDefined();- expect(store.get(marimoVersionAtom)).toBe("unknown");- expect(store.get(showCodeInRunModeAtom)).toBe(true);- },- );+ it.each([+ "edit",+ "read",+ "home",+ "run",+ ])("should mount with mode %s", (_mode) => {+ const el = document.createElement("div");+ mount({ mode: "edit" }, el);++ expect(store.get(viewStateAtom).mode).toBe("edit");+ expect(store.get(filenameAtom)).toBeDefined();+ expect(store.get(marimoVersionAtom)).toBe("unknown");+ expect(store.get(showCodeInRunModeAtom)).toBe(true);+ });it("should not mount with invalid mode", () => {const el = document.createElement("div");diff --git a/frontend/src/components/chat/acp/agent-panel.tsx b/frontend/src/components/chat/acp/agent-panel.tsxindex ceffc8649c..027c930cf9 100644--- a/frontend/src/components/chat/acp/agent-panel.tsx+++ b/frontend/src/components/chat/acp/agent-panel.tsx@@ -511,7 +511,7 @@ const ChatContent = memo<ChatContentProps>(onResolvePermission,onRetryConnection,onRetryLastAction,- onDismissError,+ onDismissError: _onDismissError,sessionId,}) => {const [isScrolledToBottom, setIsScrolledToBottom] = useState(true);diff --git a/frontend/src/components/data-table/copy-column/feature.ts b/frontend/src/components/data-table/copy-column/feature.tsindex 7c3e1ca315..ac51b84acf 100644--- a/frontend/src/components/data-table/copy-column/feature.ts+++ b/frontend/src/components/data-table/copy-column/feature.ts@@ -9,7 +9,7 @@ import type { CopyColumnOptions } from "./types";export const CopyColumnFeature: TableFeature = {getDefaultOptions: <TData extends RowData>(- table: Table<TData>,+ _table: Table<TData>,): CopyColumnOptions => {return {enableCopyColumn: true,diff --git a/frontend/src/components/editor/__tests__/data-attributes.test.tsx b/frontend/src/components/editor/__tests__/data-attributes.test.tsxindex 84b679b7f8..1a7dadd3aa 100644--- a/frontend/src/components/editor/__tests__/data-attributes.test.tsx+++ b/frontend/src/components/editor/__tests__/data-attributes.test.tsx@@ -42,106 +42,107 @@ beforeAll(() => {});describe("Cell data attributes", () => {- it.each(["edit", "read", "present"])(- "should render cell with data-cell-id and data-cell-name in %s mode",- (mode) => {- const { store, wrapper } = createTestWrapper();- const cellId = "test" as CellId;- const cellName = "test_cell";+ it.each([+ "edit",+ "read",+ "present",+ ])("should render cell with data-cell-id and data-cell-name in %s mode", (mode) => {+ const { store, wrapper } = createTestWrapper();+ const cellId = "test" as CellId;+ const cellName = "test_cell";- const userConfig: UserConfig = {- display: {- cell_output: "below",- code_editor_font_size: 14,- dataframes: "rich",- default_table_page_size: 10,- default_table_max_columns: 10,- default_width: "normal",- theme: "light",- reference_highlighting: false,- },- keymap: { preset: "default" },- completion: {- activate_on_typing: true,- copilot: false,- },- formatting: { line_length: 88 },- package_management: { manager: "pip" },- runtime: {- auto_instantiate: false,- default_sql_output: "native",- auto_reload: "off",- on_cell_change: "lazy",- watcher_on_save: "lazy",- reactive_tests: true,- output_max_bytes: 1_000_000,- std_stream_max_bytes: 1_000_000,- pythonpath: [],- dotenv: [".env"],- },- server: {- browser: "default",- follow_symlink: false,- },- save: { autosave: "off", autosave_delay: 1000, format_on_save: false },- ai: {},- } as UserConfig;+ const userConfig: UserConfig = {+ display: {+ cell_output: "below",+ code_editor_font_size: 14,+ dataframes: "rich",+ default_table_page_size: 10,+ default_table_max_columns: 10,+ default_width: "normal",+ theme: "light",+ reference_highlighting: false,+ },+ keymap: { preset: "default" },+ completion: {+ activate_on_typing: true,+ copilot: false,+ },+ formatting: { line_length: 88 },+ package_management: { manager: "pip" },+ runtime: {+ auto_instantiate: false,+ default_sql_output: "native",+ auto_reload: "off",+ on_cell_change: "lazy",+ watcher_on_save: "lazy",+ reactive_tests: true,+ output_max_bytes: 1_000_000,+ std_stream_max_bytes: 1_000_000,+ pythonpath: [],+ dotenv: [".env"],+ },+ server: {+ browser: "default",+ follow_symlink: false,+ },+ save: { autosave: "off", autosave_delay: 1000, format_on_save: false },+ ai: {},+ } as UserConfig;- const notebook = MockNotebook.notebookState({- cellData: {- [cellId]: {- code: "",- name: cellName,- edited: false,- serializedEditorState: null,- config: {- disabled: false,- hide_code: false,- column: null,- },+ const notebook = MockNotebook.notebookState({+ cellData: {+ [cellId]: {+ code: "",+ name: cellName,+ edited: false,+ serializedEditorState: null,+ config: {+ disabled: false,+ hide_code: false,+ column: null,},},- });+ },+ });- notebook.cellRuntime[cellId] = createCellRuntimeState({- status: "idle",- output: null,- consoleOutputs: [],- interrupted: false,- errored: false,- stopped: false,- staleInputs: false,- runStartTimestamp: null,- lastRunStartTimestamp: null,- runElapsedTimeMs: null,- debuggerActive: false,- outline: null,- });+ notebook.cellRuntime[cellId] = createCellRuntimeState({+ status: "idle",+ output: null,+ consoleOutputs: [],+ interrupted: false,+ errored: false,+ stopped: false,+ staleInputs: false,+ runStartTimestamp: null,+ lastRunStartTimestamp: null,+ runElapsedTimeMs: null,+ debuggerActive: false,+ outline: null,+ });- store.set(notebookAtom, notebook);+ store.set(notebookAtom, notebook);- const { container } = render(- <TooltipProvider>- <Cell- cellId={cellId}- mode={mode as AppMode}- canDelete={true}- userConfig={userConfig}- isCollapsed={false}- collapseCount={0}- canMoveX={false}- theme="light"- showPlaceholder={false}- />- </TooltipProvider>,- { wrapper },- );+ const { container } = render(+ <TooltipProvider>+ <Cell+ cellId={cellId}+ mode={mode as AppMode}+ canDelete={true}+ userConfig={userConfig}+ isCollapsed={false}+ collapseCount={0}+ canMoveX={false}+ theme="light"+ showPlaceholder={false}+ />+ </TooltipProvider>,+ { wrapper },+ );- const cellElement = container.querySelector(`[data-cell-id="${cellId}"]`);- expect(cellElement).toBeTruthy();- expect(cellElement?.getAttribute("data-cell-name")).toBe(cellName);- },- );+ const cellElement = container.querySelector(`[data-cell-id="${cellId}"]`);+ expect(cellElement).toBeTruthy();+ expect(cellElement?.getAttribute("data-cell-name")).toBe(cellName);+ });});describe("Output data attributes", () => {diff --git a/frontend/src/core/cells/__tests__/add-missing-import.test.ts b/frontend/src/core/cells/__tests__/add-missing-import.test.tsindex d85028ce48..04da33a4fd 100644--- a/frontend/src/core/cells/__tests__/add-missing-import.test.ts+++ b/frontend/src/core/cells/__tests__/add-missing-import.test.ts@@ -48,29 +48,28 @@ describe("maybeAddMissingImport", () => {"import marimo as mo\nimport marimo as mo","import marimo as mo",];- it.each(VALID_IMPORTS)(- "should not add an import if the import statement already exists in the notebook",- (code) => {- const appStore = createStore();- appStore.set(variablesAtom, {} as Variables);- appStore.set(- notebookAtom,- MockNotebook.notebookState({- cellData: {- [Cell1]: { code: code },- },- }),- );- const onAddImport = vi.fn();- maybeAddMissingImport({- moduleName: "marimo",- variableName: "mo",- onAddImport,- appStore,- });- expect(onAddImport).not.toHaveBeenCalled();- },- );+ it.each(+ VALID_IMPORTS,+ )("should not add an import if the import statement already exists in the notebook", (code) => {+ const appStore = createStore();+ appStore.set(variablesAtom, {} as Variables);+ appStore.set(+ notebookAtom,+ MockNotebook.notebookState({+ cellData: {+ [Cell1]: { code: code },+ },+ }),+ );+ const onAddImport = vi.fn();+ maybeAddMissingImport({+ moduleName: "marimo",+ variableName: "mo",+ onAddImport,+ appStore,+ });+ expect(onAddImport).not.toHaveBeenCalled();+ });it("should add an import if the variable is not in the variables state and the import statement does not exist in the notebook", () => {const appStore = createStore();diff --git a/frontend/src/core/cells/__tests__/cell.test.ts b/frontend/src/core/cells/__tests__/cell.test.tsindex b6366ef201..48aab89859 100644--- a/frontend/src/core/cells/__tests__/cell.test.ts+++ b/frontend/src/core/cells/__tests__/cell.test.ts@@ -43,20 +43,19 @@ describe("outputIsLoading", () => {});describe("outputIsStale", () => {- it.each(STATUSES)(- "should return true if the cell is edited and status is %s",- (status) => {- const cell = {- status: status,- staleInputs: true,- output: null,- runStartTimestamp: null,- interrupted: false,- };- const edited = true;- expect(outputIsStale(cell, edited)).toBe(true);- },- );+ it.each(+ STATUSES,+ )("should return true if the cell is edited and status is %s", (status) => {+ const cell = {+ status: status,+ staleInputs: true,+ output: null,+ runStartTimestamp: null,+ interrupted: false,+ };+ const edited = true;+ expect(outputIsStale(cell, edited)).toBe(true);+ });it("should return true if the cell is loading", () => {const cell = {diff --git a/frontend/src/core/codemirror/rtc/loro/awareness.ts b/frontend/src/core/codemirror/rtc/loro/awareness.tsindex c8a196e67e..2e5f77b674 100644--- a/frontend/src/core/codemirror/rtc/loro/awareness.ts+++ b/frontend/src/core/codemirror/rtc/loro/awareness.ts@@ -341,12 +341,12 @@ const getEffects = (}const anchor = Cursor.decode(state.cursor.anchor);- const anchorPos = doc.getCursorPos(anchor).offset;+ const anchorPos = doc.getCursorPos(anchor)?.offset ?? 0;let headPos = anchorPos;if (state.cursor.head) {// rangeconst head = Cursor.decode(state.cursor.head);- headPos = doc.getCursorPos(head).offset;+ headPos = doc.getCursorPos(head)?.offset ?? 0;}return remoteAwarenessEffect.of({type: "update",diff --git a/frontend/src/core/dom/__tests__/htmlUtils.test.ts b/frontend/src/core/dom/__tests__/htmlUtils.test.tsindex 1445b84329..6b198e3dc5 100644--- a/frontend/src/core/dom/__tests__/htmlUtils.test.ts+++ b/frontend/src/core/dom/__tests__/htmlUtils.test.ts@@ -6,14 +6,20 @@ import { UIElementRegistry } from "../uiregistry";const registry = UIElementRegistry.INSTANCE;describe("htmlUtils", () => {- it.each([false, { a: 1 }, true, 0, 1, [{ a: 1 }, { b: 2 }], "hello", ""])(- "can parse element.dataset.initialValue",- (initialValue) => {- const div = document.createElement("div");- div.dataset.initialValue = JSON.stringify(initialValue);- expect(parseInitialValue(div, registry)).toEqual(initialValue);- },- );+ it.each([+ false,+ { a: 1 },+ true,+ 0,+ 1,+ [{ a: 1 }, { b: 2 }],+ "hello",+ "",+ ])("can parse element.dataset.initialValue", (initialValue) => {+ const div = document.createElement("div");+ div.dataset.initialValue = JSON.stringify(initialValue);+ expect(parseInitialValue(div, registry)).toEqual(initialValue);+ });it("can parse an element with no initialValue", () => {const div = document.createElement("div");diff --git a/frontend/src/core/islands/__tests__/parse.test.ts b/frontend/src/core/islands/__tests__/parse.test.tsindex b2375f63f2..e6917aa593 100644--- a/frontend/src/core/islands/__tests__/parse.test.ts+++ b/frontend/src/core/islands/__tests__/parse.test.ts@@ -78,12 +78,11 @@ describe("parseIslandCode", () => {codes = [...codes, ...codes.map(encodeURIComponent)];- it.each(codes)(- "should return the code without leading or trailing whitespace",- (code) => {- const result = parseIslandCode(code);- const expected = 'def __():\n print("Hello, World!")\n return';- expect(result).toBe(expected);- },- );+ it.each(+ codes,+ )("should return the code without leading or trailing whitespace", (code) => {+ const result = parseIslandCode(code);+ const expected = 'def __():\n print("Hello, World!")\n return';+ expect(result).toBe(expected);+ });});diff --git a/frontend/src/core/saving/__tests__/filename.test.ts b/frontend/src/core/saving/__tests__/filename.test.tsindex 8fea6bfc88..404e9439a1 100644--- a/frontend/src/core/saving/__tests__/filename.test.ts+++ b/frontend/src/core/saving/__tests__/filename.test.ts@@ -5,13 +5,12 @@ import { EDGE_CASE_FILENAMES } from "../../../__tests__/mocks";import { Paths } from "../../../utils/paths";describe("filename handling logic", () => {- it.each(EDGE_CASE_FILENAMES)(- "should extract basename correctly for document title: %s",- (filename) => {- const basename = Paths.basename(filename);- expect(basename).toBe(filename); // Since no path separator- },- );+ it.each(+ EDGE_CASE_FILENAMES,+ )("should extract basename correctly for document title: %s", (filename) => {+ const basename = Paths.basename(filename);+ expect(basename).toBe(filename); // Since no path separator+ });it("should handle full paths with unicode filenames", () => {EDGE_CASE_FILENAMES.forEach((filename) => {diff --git a/frontend/src/core/static/__tests__/download-html.test.ts b/frontend/src/core/static/__tests__/download-html.test.tsindex ad06e1f492..b6830f69fe 100644--- a/frontend/src/core/static/__tests__/download-html.test.ts+++ b/frontend/src/core/static/__tests__/download-html.test.ts@@ -44,24 +44,23 @@ describe("updateAssetUrl", () => {});describe("filename handling for downloads", () => {- it.each(EDGE_CASE_FILENAMES)(- "should handle edge case filenames in download operations: %s",- (filename) => {- // Test that basename extraction works correctly for downloads- const basename = Paths.basename(filename);- expect(basename).toBe(filename);+ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle edge case filenames in download operations: %s", (filename) => {+ // Test that basename extraction works correctly for downloads+ const basename = Paths.basename(filename);+ expect(basename).toBe(filename);- // Test filename conversion for HTML downloads- const htmlFilename = Filenames.toHTML(filename);- expect(htmlFilename).toMatch(/\.html$/);- expect(htmlFilename).toContain(Filenames.withoutExtension(filename));+ // Test filename conversion for HTML downloads+ const htmlFilename = Filenames.toHTML(filename);+ expect(htmlFilename).toMatch(/\.html$/);+ expect(htmlFilename).toContain(Filenames.withoutExtension(filename));- // Ensure unicode and spaces are preserved in basename- const withoutExt = Filenames.withoutExtension(filename);- expect(withoutExt).not.toBe("");- expect(typeof withoutExt).toBe("string");- },- );+ // Ensure unicode and spaces are preserved in basename+ const withoutExt = Filenames.withoutExtension(filename);+ expect(withoutExt).not.toBe("");+ expect(typeof withoutExt).toBe("string");+ });it("should handle blob download filename generation", () => {// Mock URL.createObjectURL for blob testingdiff --git a/frontend/src/core/static/__tests__/files.test.ts b/frontend/src/core/static/__tests__/files.test.tsindex 7789b08370..b935f692f3 100644--- a/frontend/src/core/static/__tests__/files.test.ts+++ b/frontend/src/core/static/__tests__/files.test.ts@@ -192,21 +192,20 @@ describe("patchVegaLoader - loader.http", () => {"http://foo.com/virtual-file.json",];- it.each(pathsToTest)(- "should return file content for virtual files for %s",- async (s) => {- const virtualFiles = {- "/virtual-file.json":- "data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,- };-- const loader = createLoader();- const unpatch = patchVegaLoader(loader, virtualFiles);- const content = await loader.http(s);- unpatch();- expect(content).toBe('{"key": "value"}');- },- );+ it.each(+ pathsToTest,+ )("should return file content for virtual files for %s", async (s) => {+ const virtualFiles = {+ "/virtual-file.json":+ "data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,+ };++ const loader = createLoader();+ const unpatch = patchVegaLoader(loader, virtualFiles);+ const content = await loader.http(s);+ unpatch();+ expect(content).toBe('{"key": "value"}');+ });it("should fallback to original http method for non-virtual files", async () => {const loader = createLoader();@@ -237,21 +236,20 @@ describe("patchVegaLoader - loader.load", () => {"http://foo.com/virtual-file.json",];- it.each(pathsToTest)(- "should return file content for virtual files for %s",- async (s) => {- const virtualFiles = {- "/virtual-file.json":- "data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,- };-- const loader = createLoader();- const unpatch = patchVegaLoader(loader, virtualFiles);- const content = await loader.load(s);- unpatch();- expect(content).toBe('{"key": "value"}');- },- );+ it.each(+ pathsToTest,+ )("should return file content for virtual files for %s", async (s) => {+ const virtualFiles = {+ "/virtual-file.json":+ "data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,+ };++ const loader = createLoader();+ const unpatch = patchVegaLoader(loader, virtualFiles);+ const content = await loader.load(s);+ unpatch();+ expect(content).toBe('{"key": "value"}');+ });it("should fallback to original load method for non-virtual files", async () => {const loader = createLoader();diff --git a/frontend/src/css/globals.css b/frontend/src/css/globals.cssindex 5a05e6f270..ed649b9470 100644--- a/frontend/src/css/globals.css+++ b/frontend/src/css/globals.css@@ -31,7 +31,7 @@/* stylelint-disable-next-line import-notation */@import "tailwindcss";-@config '../../tailwind.config.cjs';+@config "../../tailwind.config.cjs";@layer base {:root {diff --git a/frontend/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx b/frontend/src/plugins/impl/data-frames/forms/__tests__/form.test.tsxindex bae77e9800..c3c5268bfc 100644--- a/frontend/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx+++ b/frontend/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx@@ -44,14 +44,16 @@ describe("renderZodSchema", () => {[...TransformTypeSchema.options],(z) => getUnionLiteral(z).value,);- it.each(Object.entries(options))(- "should render a form %s",- (name, schema: z.ZodType<unknown, FieldValues>) => {- const expected = render(<Subject schema={schema} />);+ it.each(+ Object.entries(options),+ )("should render a form %s", (name, schema: z.ZodType<+ unknown,+ FieldValues+ >) => {+ const expected = render(<Subject schema={schema} />);- expect(expected.asFragment()).toMatchSnapshot();- },- );+ expect(expected.asFragment()).toMatchSnapshot();+ });});const options = [diff --git a/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts b/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.tsindex 33abfcfde3..2c3a706503 100644--- a/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts+++ b/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts@@ -578,19 +578,20 @@ describe("makeSelectable", () => {`);});- it.each(["errorbar", "errorband", "boxplot"])(- "should return the same spec if mark is %s",- (mark) => {- const spec = {- mark,- } as unknown as VegaLiteSpec;- const newSpec = makeSelectable(spec, {});- expect(newSpec).toEqual(spec);- expect(getSelectionParamNames(newSpec)).toEqual([]);- expect(newSpec).toMatchSnapshot();- expect(parse(newSpec)).toBeDefined();- },- );+ it.each([+ "errorbar",+ "errorband",+ "boxplot",+ ])("should return the same spec if mark is %s", (mark) => {+ const spec = {+ mark,+ } as unknown as VegaLiteSpec;+ const newSpec = makeSelectable(spec, {});+ expect(newSpec).toEqual(spec);+ expect(getSelectionParamNames(newSpec)).toEqual([]);+ expect(newSpec).toMatchSnapshot();+ expect(parse(newSpec)).toBeDefined();+ });it("should add legend selection to composite charts (issue #6676)", () => {// Test case from https://github.com/marimo-team/marimo/issues/6676diff --git a/frontend/src/utils/__tests__/cell-urls.test.ts b/frontend/src/utils/__tests__/cell-urls.test.tsindex 00d5cf0b12..ca0a18b50b 100644--- a/frontend/src/utils/__tests__/cell-urls.test.ts+++ b/frontend/src/utils/__tests__/cell-urls.test.ts@@ -92,30 +92,27 @@ describe("cell-urls utilities", () => {});describe("edge case cell names with unicode and special characters", () => {- it.each(EDGE_CASE_CELL_NAMES)(- "should handle unicode cell names in createCellLink: %s",- (cellName) => {- const url = createCellLink(cellName);- expect(url).toContain("scrollTo=");- expect(url).toContain(encodeURIComponent(cellName));- },- );-- it.each(EDGE_CASE_CELL_NAMES)(- "should round-trip unicode cell names correctly: %s",- (cellName) => {- const url = createCellLink(cellName);- const hash = url.split("#")[1];- const extracted = extractCellNameFromHash(`#${hash}`);- expect(extracted).toBe(cellName);- },- );+ it.each(+ EDGE_CASE_CELL_NAMES,+ )("should handle unicode cell names in createCellLink: %s", (cellName) => {+ const url = createCellLink(cellName);+ expect(url).toContain("scrollTo=");+ expect(url).toContain(encodeURIComponent(cellName));+ });- it.each(EDGE_CASE_CELL_NAMES)(- "should allow linking to unicode cell names: %s",- (cellName) => {- expect(canLinkToCell(cellName)).toBe(true);- },- );+ it.each(+ EDGE_CASE_CELL_NAMES,+ )("should round-trip unicode cell names correctly: %s", (cellName) => {+ const url = createCellLink(cellName);+ const hash = url.split("#")[1];+ const extracted = extractCellNameFromHash(`#${hash}`);+ expect(extracted).toBe(cellName);+ });++ it.each(+ EDGE_CASE_CELL_NAMES,+ )("should allow linking to unicode cell names: %s", (cellName) => {+ expect(canLinkToCell(cellName)).toBe(true);+ });});});diff --git a/frontend/src/utils/__tests__/filenames.test.ts b/frontend/src/utils/__tests__/filenames.test.tsindex f4d8e03dcd..a0ac14f113 100644--- a/frontend/src/utils/__tests__/filenames.test.ts+++ b/frontend/src/utils/__tests__/filenames.test.ts@@ -29,20 +29,19 @@ describe("Filenames", () => {expect(Filenames.withoutExtension("test.foo.txt")).toEqual("test.foo");});- it.each(EDGE_CASE_FILENAMES)(- "should handle edge case filenames: %s",- (filename) => {- // Test all filename operations with edge cases- const withoutExt = Filenames.withoutExtension(filename);-- expect(Filenames.toMarkdown(filename)).toEqual(`${withoutExt}.md`);- expect(Filenames.toHTML(filename)).toEqual(`${withoutExt}.html`);- expect(Filenames.toPNG(filename)).toEqual(`${withoutExt}.png`);- expect(Filenames.toPY(filename)).toEqual(`${withoutExt}.py`);-- // Ensure operations preserve unicode and special characters in base name- expect(withoutExt).not.toEqual("");- expect(typeof withoutExt).toBe("string");- },- );+ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle edge case filenames: %s", (filename) => {+ // Test all filename operations with edge cases+ const withoutExt = Filenames.withoutExtension(filename);++ expect(Filenames.toMarkdown(filename)).toEqual(`${withoutExt}.md`);+ expect(Filenames.toHTML(filename)).toEqual(`${withoutExt}.html`);+ expect(Filenames.toPNG(filename)).toEqual(`${withoutExt}.png`);+ expect(Filenames.toPY(filename)).toEqual(`${withoutExt}.py`);++ // Ensure operations preserve unicode and special characters in base name+ expect(withoutExt).not.toEqual("");+ expect(typeof withoutExt).toBe("string");+ });});diff --git a/frontend/src/utils/__tests__/json-parser.test.ts b/frontend/src/utils/__tests__/json-parser.test.tsindex fe255bfc78..87b4ae1e62 100644--- a/frontend/src/utils/__tests__/json-parser.test.ts+++ b/frontend/src/utils/__tests__/json-parser.test.ts@@ -113,8 +113,8 @@ it("can convert json to tsv with fr-FR locale", () => {const locale = "fr-FR";// Handles floats with fr-FR locale (uses , as decimal separator)- expect(jsonToTSV([{ a: 3.14, b: 2.718_28 }], locale)).toEqual(- "a\tb\n3,14\t2,71828",+ expect(jsonToTSV([{ a: 3.14, b: 2.12345 }], locale)).toEqual(+ "a\tb\n3,14\t2,12345",);});diff --git a/frontend/src/utils/__tests__/path.test.ts b/frontend/src/utils/__tests__/path.test.tsindex 73e75c2429..b03c3be207 100644--- a/frontend/src/utils/__tests__/path.test.ts+++ b/frontend/src/utils/__tests__/path.test.ts@@ -170,39 +170,36 @@ describe("PathBuilder", () => {});describe("edge case filenames", () => {- it.each(EDGE_CASE_FILENAMES)(- "should handle unicode and spaces in basename: %s",- (filename) => {- const basename = Paths.basename(filename);- expect(basename).toBe(filename);- expect(typeof basename).toBe("string");- expect(basename).not.toBe("");- },- );-- it.each(EDGE_CASE_FILENAMES)(- "should handle unicode and spaces in dirname: %s",- (filename) => {- const fullPath = `/path/to/${filename}`;- const dirname = Paths.dirname(fullPath);- expect(dirname).toBe("/path/to");- },- );-- it.each(EDGE_CASE_FILENAMES)(- "should handle unicode and spaces in path operations: %s",- (filename) => {- const baseName = Paths.basename(filename);- const extension = Paths.extension(filename);-- // Should preserve unicode characters in basename- expect(baseName).toContain(filename.split(".")[0]);-- // Should correctly extract extension- if (filename.includes(".")) {- expect(extension).toBe(filename.split(".").pop());- }- },- );+ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle unicode and spaces in basename: %s", (filename) => {+ const basename = Paths.basename(filename);+ expect(basename).toBe(filename);+ expect(typeof basename).toBe("string");+ expect(basename).not.toBe("");+ });++ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle unicode and spaces in dirname: %s", (filename) => {+ const fullPath = `/path/to/${filename}`;+ const dirname = Paths.dirname(fullPath);+ expect(dirname).toBe("/path/to");+ });++ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle unicode and spaces in path operations: %s", (filename) => {+ const baseName = Paths.basename(filename);+ const extension = Paths.extension(filename);++ // Should preserve unicode characters in basename+ expect(baseName).toContain(filename.split(".")[0]);++ // Should correctly extract extension+ if (filename.includes(".")) {+ expect(extension).toBe(filename.split(".").pop());+ }+ });});});diff --git a/frontend/src/utils/__tests__/urls.test.ts b/frontend/src/utils/__tests__/urls.test.tsindex 71cecc89b9..cf4cd51395 100644--- a/frontend/src/utils/__tests__/urls.test.ts+++ b/frontend/src/utils/__tests__/urls.test.ts@@ -14,25 +14,24 @@ describe("isUrl", () => {});describe("URL parameter handling with edge case filenames", () => {- it.each(EDGE_CASE_FILENAMES)(- "should handle unicode filenames in URL parameters: %s",- (filename) => {- // Test that updateQueryParams can handle unicode filenames- updateQueryParams((params) => {- params.set("file", filename);- });-- // Verify URL encoding/decoding works with unicode- const encoded = encodeURIComponent(filename);- const decoded = decodeURIComponent(encoded);- expect(decoded).toBe(filename);-- // Verify filename can be safely added to URL parameters- const url = new URL("https://example.com");- url.searchParams.set("file", filename);- expect(url.searchParams.get("file")).toBe(filename);- },- );+ it.each(+ EDGE_CASE_FILENAMES,+ )("should handle unicode filenames in URL parameters: %s", (filename) => {+ // Test that updateQueryParams can handle unicode filenames+ updateQueryParams((params) => {+ params.set("file", filename);+ });++ // Verify URL encoding/decoding works with unicode+ const encoded = encodeURIComponent(filename);+ const decoded = decodeURIComponent(encoded);+ expect(decoded).toBe(filename);++ // Verify filename can be safely added to URL parameters+ const url = new URL("https://example.com");+ url.searchParams.set("file", filename);+ expect(url.searchParams.get("file")).toBe(filename);+ });it("should preserve unicode in query string round-trip", () => {EDGE_CASE_FILENAMES.forEach((filename) => {diff --git a/package.json b/package.jsonindex 56e716e45b..d12305b152 100644--- a/package.json+++ b/package.json@@ -9,7 +9,7 @@"dev": "pnpm run --filter @marimo-team/frontend dev"},"devDependencies": {- "@biomejs/biome": "2.2.2",+ "@biomejs/biome": "2.3.8","@testing-library/jest-dom": "^6.9.1","@typescript/native-preview": "7.0.0-dev.20251029.1","turbo": "^2.5.6",diff --git a/packages/lsp/index.ts b/packages/lsp/index.tsindex 384c2e5a73..d04842d4b1 100644--- a/packages/lsp/index.ts+++ b/packages/lsp/index.ts@@ -208,7 +208,7 @@ async function main(): Promise<void> {const logFile = argv["log-file"] || "/tmp/lsp-server.log";const logger = await Logger.create(logFile);- const serverPort = Number.parseInt(argv.port) || 3000;+ const serverPort = Number.parseInt(argv.port, 10) || 3000;const languageServerCommand = parseTypedCommand(argv.lsp || "echo test");logger.log(`Parsed LSP command: ${languageServerCommand.join(" ")}`);diff --git a/packages/lsp/package.json b/packages/lsp/package.jsonindex ff7776a8c0..b390688a37 100644--- a/packages/lsp/package.json+++ b/packages/lsp/package.json@@ -14,7 +14,7 @@"@github/copilot-language-server": "^1.366.0"},"devDependencies": {- "@biomejs/biome": "2.2.2",+ "@biomejs/biome": "2.3.8","@types/minimist": "^1.2.5","@types/node": "^24.3.0","@types/ws": "^8.18.1",diff --git a/packages/smart-cells/src/utils/python-ast.ts b/packages/smart-cells/src/utils/python-ast.tsindex 0ec3a9704e..67748e4f23 100644--- a/packages/smart-cells/src/utils/python-ast.ts+++ b/packages/smart-cells/src/utils/python-ast.ts@@ -32,7 +32,7 @@ export function parseArgsKwargs(code: string,): ParsedArgs {if (argCursor.name !== "ArgList") {- // biome-ignore lint/suspicious/noConsole: <explanation>+ // biome-ignore lint/suspicious/noConsole: useful for debugging AST parsing issuesconsole.warn(`Not an ArgList, name: ${argCursor.name}`);return { args: [], kwargs: [] };}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex f188c42164..004f39b10c 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -20,8 +20,8 @@ importers:.:devDependencies:'@biomejs/biome':- specifier: 2.2.2- version: 2.2.2+ specifier: 2.3.8+ version: 2.3.8'@testing-library/jest-dom':specifier: ^6.9.1version: 6.9.1@@ -522,8 +522,8 @@ importers:specifier: ^7.25.9version: 7.27.1(@babel/[email protected])'@biomejs/biome':- specifier: 2.2.2- version: 2.2.2+ specifier: 2.3.8+ version: 2.3.8'@codecov/vite-plugin':specifier: ^1.9.1version: 1.9.1([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))@@ -694,8 +694,8 @@ importers:version: 1.367.0devDependencies:'@biomejs/biome':- specifier: 2.2.2- version: 2.2.2+ specifier: 2.3.8+ version: 2.3.8'@types/minimist':specifier: ^1.2.5version: 1.2.5@@ -1010,55 +1010,55 @@ packages:resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}engines: {node: '>=6.9.0'}- '@biomejs/[email protected]':- resolution: {integrity: sha512-j1omAiQWCkhuLgwpMKisNKnsM6W8Xtt1l0WZmqY/dFj8QPNkIoTvk4tSsi40FaAAkBE1PU0AFG2RWFBWenAn+w==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-Qjsgoe6FEBxWAUzwFGFrB+1+M8y/y5kwmg5CHac+GSVOdmOIqsAiXM5QMVGZJ1eCUCLlPZtq4aFAQ0eawEUuUA==}engines: {node: '>=14.21.3'}hasBin: true- '@biomejs/[email protected]':- resolution: {integrity: sha512-6ePfbCeCPryWu0CXlzsWNZgVz/kBEvHiPyNpmViSt6A2eoDf4kXs3YnwQPzGjy8oBgQulrHcLnJL0nkCh80mlQ==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-HM4Zg9CGQ3txTPflxD19n8MFPrmUAjaC7PQdLkugeeC0cQ+PiVrd7i09gaBS/11QKsTDBJhVg85CEIK9f50Qww==}engines: {node: '>=14.21.3'}cpu: [arm64]os: [darwin]- '@biomejs/[email protected]':- resolution: {integrity: sha512-Tn4JmVO+rXsbRslml7FvKaNrlgUeJot++FkvYIhl1OkslVCofAtS35MPlBMhXgKWF9RNr9cwHanrPTUUXcYGag==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-lUDQ03D7y/qEao7RgdjWVGCu+BLYadhKTm40HkpJIi6kn8LSv5PAwRlew/DmwP4YZ9ke9XXoTIQDO1vAnbRZlA==}engines: {node: '>=14.21.3'}cpu: [x64]os: [darwin]- '@biomejs/[email protected]':- resolution: {integrity: sha512-/MhYg+Bd6renn6i1ylGFL5snYUn/Ct7zoGVKhxnro3bwekiZYE8Kl39BSb0MeuqM+72sThkQv4TnNubU9njQRw==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-PShR4mM0sjksUMyxbyPNMxoKFPVF48fU8Qe8Sfx6w6F42verbwRLbz+QiKNiDPRJwUoMG1nPM50OBL3aOnTevA==}engines: {node: '>=14.21.3'}cpu: [arm64]os: [linux]- '@biomejs/[email protected]':- resolution: {integrity: sha512-JfrK3gdmWWTh2J5tq/rcWCOsImVyzUnOS2fkjhiYKCQ+v8PqM+du5cfB7G1kXas+7KQeKSWALv18iQqdtIMvzw==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-Uo1OJnIkJgSgF+USx970fsM/drtPcQ39I+JO+Fjsaa9ZdCN1oysQmy6oAGbyESlouz+rzEckLTF6DS7cWse95g==}engines: {node: '>=14.21.3'}cpu: [arm64]os: [linux]- '@biomejs/[email protected]':- resolution: {integrity: sha512-ZCLXcZvjZKSiRY/cFANKg+z6Fhsf9MHOzj+NrDQcM+LbqYRT97LyCLWy2AS+W2vP+i89RyRM+kbGpUzbRTYWig==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-YGLkqU91r1276uwSjiUD/xaVikdxgV1QpsicT0bIA1TaieM6E5ibMZeSyjQ/izBn4tKQthUSsVZacmoJfa3pDA==}engines: {node: '>=14.21.3'}cpu: [x64]os: [linux]- '@biomejs/[email protected]':- resolution: {integrity: sha512-Ogb+77edO5LEP/xbNicACOWVLt8mgC+E1wmpUakr+O4nKwLt9vXe74YNuT3T1dUBxC/SnrVmlzZFC7kQJEfquQ==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-QDPMD5bQz6qOVb3kiBui0zKZXASLo0NIQ9JVJio5RveBEFgDgsvJFUvZIbMbUZT3T00M/1wdzwWXk4GIh0KaAw==}engines: {node: '>=14.21.3'}cpu: [x64]os: [linux]- '@biomejs/[email protected]':- resolution: {integrity: sha512-wBe2wItayw1zvtXysmHJQoQqXlTzHSpQRyPpJKiNIR21HzH/CrZRDFic1C1jDdp+zAPtqhNExa0owKMbNwW9cQ==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-H4IoCHvL1fXKDrTALeTKMiE7GGWFAraDwBYFquE/L/5r1927Te0mYIGseXi4F+lrrwhSWbSGt5qPFswNoBaCxg==}engines: {node: '>=14.21.3'}cpu: [arm64]os: [win32]- '@biomejs/[email protected]':- resolution: {integrity: sha512-DAuHhHekGfiGb6lCcsT4UyxQmVwQiBCBUMwVra/dcOSs9q8OhfaZgey51MlekT3p8UwRqtXQfFuEJBhJNdLZwg==}+ '@biomejs/[email protected]':+ resolution: {integrity: sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w==}engines: {node: '>=14.21.3'}cpu: [x64]os: [win32]@@ -10666,39 +10666,39 @@ snapshots:'@babel/helper-string-parser': 7.27.1'@babel/helper-validator-identifier': 7.28.5- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optionalDependencies:- '@biomejs/cli-darwin-arm64': 2.2.2- '@biomejs/cli-darwin-x64': 2.2.2- '@biomejs/cli-linux-arm64': 2.2.2- '@biomejs/cli-linux-arm64-musl': 2.2.2- '@biomejs/cli-linux-x64': 2.2.2- '@biomejs/cli-linux-x64-musl': 2.2.2- '@biomejs/cli-win32-arm64': 2.2.2- '@biomejs/cli-win32-x64': 2.2.2-- '@biomejs/[email protected]':+ '@biomejs/cli-darwin-arm64': 2.3.8+ '@biomejs/cli-darwin-x64': 2.3.8+ '@biomejs/cli-linux-arm64': 2.3.8+ '@biomejs/cli-linux-arm64-musl': 2.3.8+ '@biomejs/cli-linux-x64': 2.3.8+ '@biomejs/cli-linux-x64-musl': 2.3.8+ '@biomejs/cli-win32-arm64': 2.3.8+ '@biomejs/cli-win32-x64': 2.3.8++ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true- '@biomejs/[email protected]':+ '@biomejs/[email protected]':optional: true'@braintree/[email protected]': {}