docs/guides/lint_rules/rules/invalid_syntax.md
šØ Breaking ā Not Fixable
MB005: Cell contains code that throws a SyntaxError on compilation.
Attempts to compile each cell using marimo's internal compiler and catches any SyntaxError exceptions that occur during the compilation process.
Cells with syntax errors cannot be executed, making the notebook non-functional. SyntaxErrors prevent marimo from creating the dependency graph and running the reactive execution system, breaking the core functionality of the notebook.
Problematic:
# Invalid indentation
if True:
print("Hello") # Missing indentation
Problematic:
# Invalid syntax
x = 1 + # Missing operand
Problematic:
# Mismatched brackets
my_list = [1, 2, 3 # Missing closing bracket
Solution:
# Fix indentation
if True:
print("Hello") # Proper indentation
Solution:
# Complete expressions
x = 1 + 2 # Complete arithmetic expression
Solution:
# Match brackets
my_list = [1, 2, 3] # Proper closing bracket