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

ruff server does not merge editor settings with fallback settings #11258

Closed
snowsignal opened this issue May 3, 2024 · 1 comment · Fixed by #11266
Closed

ruff server does not merge editor settings with fallback settings #11258

snowsignal opened this issue May 3, 2024 · 1 comment · Fixed by #11266
Assignees
Labels
bug Something isn't working server Related to the LSP server

Comments

@snowsignal
Copy link
Member

If no file-based configuration exists for a workspace, only the fallback settings are used, and they are not combined with editor settings. The expected behavior is that editor settings should still be merged with fallback settings.

@akthe-at
Copy link

akthe-at commented May 4, 2024

@snowsignal Does this PR solve this scenario:
Windows 10
Neovim Nightly Latest
Ruff 0.4.3
Python 3.12.3

  • Have global config in ~/.config/ruff/pyproject.toml
  • Create "test.py" in ~/ (not a project/workspace and there is no present .toml config)
  • Create a test function
def this_function(y: int, x: int) -> int:


    """ This is an example function """


    word_fx: int = 0
    return y + x + word_fx
  • Notice the excessive space between function definition and doc strings...
  • Attempt to save (my neovim config would use conform.nvim to call ruff to format on save)
  • 2-4 second hang...ruff errors and times out (  Warn 8:53:50 PM notify.warn [LSP][ruff] timeout)
  • Curve ball...wait a minute or two to type this example/report up...go to save and it formats successfully this time.
  • This does not occur in projects with a local .toml file...
  • I am assuming this is because it takes time to look for the global config and it doesn't merge with the editor config without the local config?

snowsignal added a commit that referenced this issue May 4, 2024
…onfiguration exists (#11266)

## Summary

Fixes #11258.

This PR fixes the settings resolver to match the expected behavior when
file-based configuration is not available.

## Test Plan

In a workspace with no file-based configuration, set a setting in your
editor and confirm that this setting is used instead of the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Related to the LSP server
Projects
None yet
2 participants