-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't workingserverRelated to the LSP serverRelated to the LSP server
Description
Keywords: I001, Organize imports, first-party
Ruff version : 0.4.2
If I'm not mistaken, ruff server currently treats first-party libraries like they're third-party libraries, which is not the case for ruff-lsp.
Here is a minimal setup to reproduce this:
- Create a new project with the following layout:
.
├── pyproject.toml
└── src
└── hello_world
├── __init__.py
├── module.py
└── other_module.pywith these contents:
pyproject.toml
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "hello-world"
version = "0.0.1"
dependencies = [
"numpy"
]
[tool.ruff]
lint.extend-select = ["I"]module.py
hello = "hello world"other_module.py
from pathlib import Path
from numpy.linalg import norm
from hello_world.module import hello- Then run
ruff-lspin an editor => this should not lint the import order, just like doingruff check .doesn't say anything about import order - Then run
ruff serverin an editor => now there should be anOrganize importlint, and if you apply it, it should bring thehello_worldimport just above thenumpyimport, which is not the expected behavior
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingserverRelated to the LSP serverRelated to the LSP server