Open toinbis opened 4 months ago
I have issues with import formats on save not respect the ruff config file.
"ruff.lint.args": [ "--config=${workspaceFolder}/src/shared_core/static_configs/ruff.toml", "check", "--unsafe-fixes", "--fix" ], "ruff.format.args": [ "--config=${workspaceFolder}/src/shared_core/static_configs/ruff.toml", "--preview" ], "[python]": { "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": "always", "source.organizeImports": "always" }, "editor.defaultFormatter": "charliermarsh.ruff" },
This is my vscode settings.json. I get consistent behaviour (=reading and using custom config file location) for:
I.e. All as expected!
Until I want to do organize imports automatically on save. So these settings come into effect:
"[python]": { "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": "always", "source.organizeImports": "always" }, "editor.defaultFormatter": "charliermarsh.ruff" }
And they seem to just use default ruff without any custom config. And it just formats differentely!
"ruff.lint.run": "onType|onSave", seemed like a setting which could help, but this settings, as shown by VSCode, is invalid.
"ruff.lint.run": "onType|onSave",
How do I sort imports on save when using custom ruff config file location?
Thanks
Thank you for opening the issue! Can you provide the content in your config file? And can you expand on how "it formats differently"? Like, what is the expected behavior and what are you actually getting?
I have issues with import formats on save not respect the ruff config file.
This is my vscode settings.json. I get consistent behaviour (=reading and using custom config file location) for:
I.e. All as expected!
Until I want to do organize imports automatically on save. So these settings come into effect:
And they seem to just use default ruff without any custom config. And it just formats differentely!
"ruff.lint.run": "onType|onSave",
seemed like a setting which could help, but this settings, as shown by VSCode, is invalid.How do I sort imports on save when using custom ruff config file location?
Thanks