vscode-ruff icon indicating copy to clipboard operation
vscode-ruff copied to clipboard

A problem when using format file for ruff in Windows and Linux

Open DK05310214 opened this issue 1 year ago • 4 comments

I'm using Ruff for code formatting across different systems and have hit a snag with specifying a format file path in my settings. This setup causes an error when switching systems because the file path is not recognized on the new platform.

Is there a way to make Ruff dynamically adjust the file path based on the operating system it's running on? This would greatly enhance its usability in multi-OS environments.

image

DK05310214 avatar Apr 09 '24 06:04 DK05310214

@DK05310214 no, Ruff has no such functionality. I understand that you want to configure different paths on different systems (/platforms?) because the file is stored at a different location.

CC: @snowsignal I think this is interesting when thinking about the new settings

MichaReiser avatar Apr 09 '24 06:04 MichaReiser

@DK05310214 no, Ruff has no such functionality. I understand that you want to configure different paths on different systems (/platforms?) because the file is stored at a different location.

CC: @snowsignal I think this is interesting when thinking about the new settings

Thanks for reply. I think this feature may be very useful. The paths to configuration file can be set as a list. We can iterate through this list to search for configuration file and pass the file that found for the first time to ruff.

DK05310214 avatar Apr 09 '24 08:04 DK05310214

Would it work if you place the file in your home directory and pass a relative path --config ~/path/to/ruff.toml ?

MichaReiser avatar Apr 11 '24 08:04 MichaReiser