# Ruff and mypy on an API Project

Ruff finds likely mistakes in an API's code and lays out every file the same way, and mypy reads the type hints that FastAPI, Pydantic and the data module already have to find values that can't be what a function expects, both set up once for the whole project in pyproject.toml.

![Cheat sheet: Ruff and mypy on an API Project](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/e8b57d873d0c48418df95d3fb8edc936.webp)

- Category: FastAPI
- Level: Journeyman
- Tags: Code Formatter, fastapi, Linter, mypy, pyproject.toml, python, Ruff, software-development, Type Checker
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-pro-ruff-and-mypy-cheat-sheet
