From 9af85976086cb07e1916e77539aff2c9337117a6 Mon Sep 17 00:00:00 2001 From: Brent Westbrook <36778786+ntBre@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:29:38 -0400 Subject: [PATCH] Skip notebook with errors in ecosystem check (#19491) Summary -- I've been noticing this failure in the formatter ecosystem check and decided to look into it. We fail to parse the [notebook](https://github.com/openai/openai-cookbook/blob/main/examples/mcp/databricks_mcp_cookbook.ipynb) because some of the `code` cells have non-Python code in them. `ruff format` only reports one of these, corresponding to a shell snippet, but `ruff check` emits some additional errors about JS code later in the file too: ``` databricks_mcp_cookbook.ipynb:cell 21:1:11: SyntaxError: Simple statements must be separated by newlines or semicolons databricks_mcp_cookbook.ipynb:cell 21:1:19: SyntaxError: Simple statements must be separated by newlines or semicolons databricks_mcp_cookbook.ipynb:cell 21:1:50: SyntaxError: Simple statements must be separated by newlines or semicolons databricks_mcp_cookbook.ipynb:cell 30:4:7: SyntaxError: Simple statements must be separated by newlines or semicolons databricks_mcp_cookbook.ipynb:cell 30:4:41: E703 Statement ends with an unnecessary semicolon databricks_mcp_cookbook.ipynb:cell 30:5:14: SyntaxError: Expected ':', found '{' databricks_mcp_cookbook.ipynb:cell 30:6:9: SyntaxError: Expected ',', found '{' databricks_mcp_cookbook.ipynb:cell 30:6:25: SyntaxError: Expected ',', found '=' databricks_mcp_cookbook.ipynb:cell 30:6:46: SyntaxError: Expected ',', found ';' databricks_mcp_cookbook.ipynb:cell 30:6:47: SyntaxError: Expected '}', found newline databricks_mcp_cookbook.ipynb:cell 30:7:1: SyntaxError: Unexpected indentation databricks_mcp_cookbook.ipynb:cell 30:7:13: SyntaxError: Expected ':', found 'break' databricks_mcp_cookbook.ipynb:cell 30:7:18: E703 Statement ends with an unnecessary semicolon databricks_mcp_cookbook.ipynb:cell 30:8:28: SyntaxError: Simple statements must be separated by newlines or semicolons databricks_mcp_cookbook.ipynb:cell 30:8:55: E703 Statement ends with an unnecessary semicolon databricks_mcp_cookbook.ipynb:cell 30:9:18: SyntaxError: Expected an expression databricks_mcp_cookbook.ipynb:cell 30:10:11: SyntaxError: Expected ',', found name databricks_mcp_cookbook.ipynb:cell 30:10:16: SyntaxError: Expected ',', found '=' databricks_mcp_cookbook.ipynb:cell 30:10:22: SyntaxError: Expected ',', found name databricks_mcp_cookbook.ipynb:cell 30:10:24: SyntaxError: Expected ',', found ';' databricks_mcp_cookbook.ipynb:cell 30:11:27: SyntaxError: Expected ',', found '=' databricks_mcp_cookbook.ipynb:cell 30:11:34: SyntaxError: Expected ',', found name databricks_mcp_cookbook.ipynb:cell 30:11:48: SyntaxError: Expected ',', found ';' databricks_mcp_cookbook.ipynb:cell 30:11:49: SyntaxError: Expected '}', found NonLogicalNewline databricks_mcp_cookbook.ipynb:cell 30:12:1: SyntaxError: Unexpected indentation databricks_mcp_cookbook.ipynb:cell 30:12:16: E703 Statement ends with an unnecessary semicolon databricks_mcp_cookbook.ipynb:cell 30:13:3: SyntaxError: Expected a statement databricks_mcp_cookbook.ipynb:cell 30:13:4: SyntaxError: Expected a statement databricks_mcp_cookbook.ipynb:cell 30:13:5: SyntaxError: Expected a statement databricks_mcp_cookbook.ipynb:cell 30:13:5: E703 Statement ends with an unnecessary semicolon databricks_mcp_cookbook.ipynb:cell 30:13:6: SyntaxError: Expected a statement databricks_mcp_cookbook.ipynb:cell 30:14:1: SyntaxError: Expected a statement databricks_mcp_cookbook.ipynb:cell 30:14:2: SyntaxError: Expected a statement ``` Test Plan -- This PR --- python/ruff-ecosystem/ruff_ecosystem/defaults.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/ruff-ecosystem/ruff_ecosystem/defaults.py b/python/ruff-ecosystem/ruff_ecosystem/defaults.py index 3c07c571ee..1e081a155f 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/defaults.py +++ b/python/ruff-ecosystem/ruff_ecosystem/defaults.py @@ -129,6 +129,14 @@ DEFAULT_TARGETS = [ "examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", ], }, + format_options=FormatOptions( + exclude=( + "examples/mcp/databricks_mcp_cookbook.ipynb," + "examples/chatgpt/gpt_actions_library/gpt_action_google_drive.ipynb," + "examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb," + "examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb," + ) + ), ), Project(repo=Repository(owner="agronholm", name="anyio", ref="master")), Project(repo=Repository(owner="python-trio", name="trio", ref="main")),