Open mounirmesselmeni opened 9 months ago
Hey, this is because it's one of the arguments which isn't supported for the format.args
field: https://github.com/astral-sh/ruff-lsp/blob/187d7790be0783b9ac41ce025a724cf389bf575c/ruff_lsp/server.py#L199-L213
Are you not seeing any warnings for it?
I think we could allow --no-force-exclude
? It would just mean that all files are formatted regardless of whether they're marked for exclusion (so even, e.g., files in the standard library would get formatted, if you opened them up). Is that what you wanted to achieve?
@dhruvmanila No warnings, only info logs.
@charliermarsh correct, on the other hand, if I open a standard library of third party library in VSCode, modify and save it it might still be okay to have it formatted, that is mainly done for debugging purposes and would be anyway reverted afterwards.
As a user, I would find it annoying to always revert back the change which an extension made. But, I could see us providing an option to do so. (cc @snowsignal something to think on for the config proposal)
Coming here with this usecase:
I have a ruff config that I'd like to have enforced in CI/CD and with pre-commit, but I'd like to make sure that even files that I've marked as excluded are still within the scope of what the ruff extension in vscode can work with, so I can apply ruff "optionally" on these files.
@jvacek can you try the new native server by setting ruff.nativeServer: "on"
(https://docs.astral.sh/ruff/editors/settings/#nativeserver) ? Does that resolve your use-case?
Under native server, I don't see the intended behaviour either. It seems that the exclude is still being applied.
@jvacek Can you provide a way for us to reproduce (Ruff and VS Code settings, directory structure, etc.) ?
I was trying to pass --no-force-exclude to Ruff format but it seems to be ignored.
Output from the extension:
Use case: I wanted to be able (while generally ignored migrations files), when adding Django migrations by hand, to be able to format them using Ruff. That was the case with Black and black extension before switching to Ruff, I believe the black extension was ignoring the ignore list.