Skip to content

Allow flymake-ruff to use Ruff config files from remote TRAMP hosts#24

Open
struan-robertson wants to merge 6 commits into
erickgnavar:masterfrom
struan-robertson:master
Open

Allow flymake-ruff to use Ruff config files from remote TRAMP hosts#24
struan-robertson wants to merge 6 commits into
erickgnavar:masterfrom
struan-robertson:master

Conversation

@struan-robertson

@struan-robertson struan-robertson commented Dec 28, 2024

Copy link
Copy Markdown

flymake-ruff uses a local Ruff executable when checking a remote TRAMP file, which is preferable as the code checked is confined to the buffer and running commands over TRAMP can be slow. However, flymake-ruff tries to pass the full TRAMP path (i.e. /ssh:remote:/path/to/pyproject.toml) to Ruff as the config file location. This pull request copies the remote config file to /tmp on the local machine so that it can be passed to the Ruff executable. To stop TRAMP slowing to a crawl and prevent reentrant errors, the config is cached in tmp and can be refreshed by reverting the buffer.

@struan-robertson struan-robertson marked this pull request as draft December 28, 2024 17:34
Don't pollute /tmp

Fix error on directory existing

Cache config and use tramp-handle-* funcitons to stop TRAMP reentrant errors
@struan-robertson struan-robertson marked this pull request as ready for review December 28, 2024 23:17
@erickgnavar

Copy link
Copy Markdown
Owner

Hi, thanks for your contribution, I'll have to do some tests before merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants