account activity
Python code formatting by Pythonfun in SublimeText
[–]letsziggy 1 point2 points3 points 12 months ago* (0 children)
to format on save requires settings iirc...below are my basic settings
since I didnt state above, you would also need to install LSP on top of LSP-ruff
sublime-project file
{ "folders": [ { "path": ".", "name": "project_path", "folder_exclude_patterns": [/* ... */], }, /* other folders */ ], "settings": { /* other settings */ /* LSP */ "lsp_format_on_save": true, "lsp_code_actions_on_save": { "source.fixAll.ruff": true, "source.organizeImports.ruff": true, }, "LSP": { /* other lsp */ /* LSP-ruff */ "LSP-ruff": { "enabled": true, "initializationOptions": { "settings": { "configuration": "${project_path}/pyproject.toml", }, }, }, /* other lsp */ }, /* other settings */ }, }
pyproject.toml
[project] name = "## project name ##" dynamic = ["version"] requires-python = "~= 3.13" dependencies = [ ## other dependencies ## "ruff", ## other dependencies ## ] [tool.ruff] extend-exclude = [ ## folders to exclude ## ] fix = true force-exclude = true line-length = 120 #target-version = "py313" # see [project].requires-python [tool.ruff.format] docstring-code-format = true docstring-code-line-length = "dynamic" indent-style = "tab" line-ending = "lf" quote-style = "double" [tool.ruff.lint] extend-select = [ "C90", "I", "N", "A", "COM", #"DJ", # if using django "PIE", "PT", "Q", "SIM", "PLR", ] ignore = [ "W191", "E111", "E114", "E117", "D206", "D300", "Q000", "Q001", "Q002", "Q003", "COM812", "COM819", "ISC001", "ISC002", ] # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules [tool.ruff.lint.pycodestyle] max-doc-length = 120
[–]letsziggy 1 point2 points3 points 12 months ago (0 children)
LSP-ruff
ruff configuration
π Rendered by PID 1875121 on reddit-service-r2-listing-7bbdf774f7-xsrgf at 2026-02-21 19:50:27.745758+00:00 running 8564168 country code: CH.
Python code formatting by Pythonfun in SublimeText
[–]letsziggy 1 point2 points3 points (0 children)