Format and lint files
Run a targeted tool while you edit, then run the repository checks before opening a pull request. Formatters rewrite layout. Linters report problems with the file's content or conventions. Some linters can also apply fixes.
Choose the command for your file
Run the commands from the repository root. Substitute the path you changed.
Python
Run ruff check src/example.py to lint the file and ruff format --check src/example.py to check its formatting. Drop --check from the formatter command to rewrite the file. Once your dependencies are synced, run ty check to catch type errors. Ruff ยท ty
Markdown
Run rumdl check website/index.md to see the rule and line for each problem. Use rumdl fmt website/index.md to apply available fixes. rumdl
TOML
Run tombi lint zensical.toml to check it and tombi format --check zensical.toml to check formatting separately. Drop --check from the formatter command to rewrite the file. Tombi
JSON and web files
Run biome check .devcontainer/devcontainer.json for diagnostics. Use biome format --write .devcontainer/devcontainer.json to apply formatting. Biome
YAML
Run prek run check-yaml --files .github/workflows/ci.yml. Fix the syntax error at the location in the output and rerun it. Prek
Bash
Run shellcheck scripts/setup.sh and use the reported ShellCheck rule to understand the correction. ShellCheck
Review the changes
Use git diff to see what a formatter changed. If a hook rewrites a staged file, review the working-tree version, then stage the intended changes again. Run Prek on the files you changed before you retry the commit.
If your editor and a formatter disagree, check the EditorConfig settings for basic whitespace behavior and the tool reference for the formatter's own rules. Configure format-on-save to use the same tool as the repository where your editor supports it.