-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP: Format File -- ruff.toml settings ignored #92
Comments
Can you provide an LSP log panel output when formatting? |
LSP Log Panel Content after launch and format
|
Running If I put the
|
From ruff docs: config file discovery:
$ ls -l ~/ruff.toml
"/home/andy/ruff.toml": No such file or directory (os error 2)
$ ruff -v format --diff main.py 1>/dev/null
[2024-12-20][10:11:10][ruff::resolve][DEBUG] Using configuration file (via cwd) at: /home/andy/.config/ruff/ruff.toml
[2024-12-20][10:11:10][ruff_workspace::pyproject][DEBUG] `project.requires_python` in `pyproject.toml` will not be used to set `target_version` when using `ruff.toml`.
[2024-12-20][10:11:10][ignore::gitignore][DEBUG] opened gitignore file: /home/andy/.gitignore
[2024-12-20][10:11:10][ruff::commands::format][DEBUG] format_path; path=/home/andy/Code/rufflsptest/main.py
[2024-12-20][10:11:10][tracing::span][DEBUG] Printer::print;
[2024-12-20][10:11:10][ruff::commands::format][DEBUG] Formatted 1 files in 451.04µs
1 file would be reformatted
$ ruff -V
ruff 0.8.4 See also: useless-try-except (TRY203) |
Could be that the behavior difference comes from the fact that ruff used by this package is not at the latest version (see #91). When testing I have also used some older version of ruff so that's why my results might not be consistent with yours. |
Hello!
I have the following
~/.config/ruff/ruff.toml
, and I'd like this plugin to use that configuration, at least in the absence of a more local configuration file.ruff.toml
To that end, I've configured this plugin as:
I test with the following
main.py
:On the command line, I can see what
ruff format
will do, following my configuration:$ ruff format --diff main.py
But when I choose
LSP: Format File
from the command palette, the following changes are made:Here is my troubleshooting output:
LSP: Troubleshoot Server
Troubleshooting: LSP-ruff
Version
Server Test Run
Server Configuration
"/home/andy/.cache/sublime-text/Package Storage/LSP-ruff/bin/ruff" server
Active view
Project / Workspace
[ "/home/andy/Code/rufflsptest" ]
LSP configuration
System PATH
The text was updated successfully, but these errors were encountered: