samperalabs
Home
Projects
Blog
About
Contact
Home
Projects
Blog
About
Contact
← Back to post
Edit Post
Title
*
Author
*
Description
How to set up ruff and uv when working in python projects
Publication Date
Tags
Separate tags with commas
Content
*
H1
H2
H3
H4
## The Problem In the last months uv has gained a lot of popularity, and with it ruff also. This is my actual setup for it. Install the extension ruff on vscode/cursor and following these steps ### Pyproject.toml Add this configuration ```toml [tool.ruff] # Enable auto-fixing fix = true unsafe-fixes = false lint.select = [ "E", # pycodestyle "F", # pyflakes "I", # isort "D", # pydocstyle "D401", # First line should be in imperative mood "T201", "UP", ] lint.ignore = [ "UP006", "UP007", "UP035", "D417", "E501", ] [tool.ruff.lint.per-file-ignores] "tests/*" = ["D", "UP"] [tool.ruff.lint.pydocstyle] convention = "google" ``` ### .vscode/settings.json ```jsonc { "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": "explicit", "source.organizeImports": "explicit" }, "[python]": { "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": "explicit", "source.organizeImports": "explicit" } }, "ruff.enable": true, "ruff.fixAll": true, "ruff.organizeImports": true } ```
Update Post
Cancel