Skip to content
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

Fall back to python module if ruff executable is missing #70

Merged

Conversation

chris-reeves
Copy link
Contributor

There are a couple of ways to fix #69.

  • return an empty string after logging the error on line 520;
  • fall back to running ruff via the python module (similar to previous behaviour, but with the option to not even attempt to run the executable if it's not specified).

This fix implements the second option as that will provide a better user experience. This assumes commit ea5f874 was simply intended to shortcut the attempt to call the executable if it was not set, rather than intended to remove the fallback behaviour.

Assigning to the p variable prior to opening pipes and checking for a None value felt like a better option than skipping the initial assignment and then trying to detect whether the variable has had a value assigned.

@chris-reeves chris-reeves force-pushed the fix-69_handle-missing-executable branch 2 times, most recently from d216f58 to 7284a87 Compare December 22, 2023 15:55
@chris-reeves chris-reeves force-pushed the fix-69_handle-missing-executable branch from 7284a87 to 3249bde Compare December 22, 2023 16:05
@jhossbach
Copy link
Member

Good catch, thanks for the PR!

@jhossbach jhossbach merged commit 8a6fac9 into python-lsp:main Dec 26, 2023
5 checks passed
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.

Missing ruff executable breaks other linters
2 participants