If you want to run code checker and formatted such as ruff, isort, pyupgrade, mypy, pylint, flake8, black, and more on Jupyter Notebooks, use nbQA.
nbQA also supports pre-commit to automatically run nbQA upon committing the notebook.
Link to nbQA.
Ruff: The Fast All-in-One Python Code Quality Tool
marimo: Reactive Notebooks for Effortless Visualizations
Jupytext: Transform Notebooks into Version Control-Friendly Text