Skip to content

Commit 48e5ee0

Browse files
committed
refactor: add ruff rules for sorting imports
1 parent 4ef394d commit 48e5ee0

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

plugin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
from LSP.plugin import ClientConfig, Response, WorkspaceFolder
1+
from __future__ import annotations
2+
3+
from LSP.plugin import ClientConfig
4+
from LSP.plugin import Response
5+
from LSP.plugin import WorkspaceFolder
26
from LSP.plugin.core.protocol import InitializeResult
3-
from LSP.plugin.core.typing import cast, List, Optional
7+
from LSP.plugin.core.typing import cast
8+
from LSP.plugin.core.typing import List
9+
from LSP.plugin.core.typing import Optional
410
from lsp_utils import NpmClientHandler
511
import os
612
import sublime

pyproject.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
[tool.pyright]
2-
pythonVersion = '3.11'
2+
pythonVersion = "3.8"
33

44
[tool.ruff]
55
select = ["E", "F", "W"]
66
ignore = ["F401"]
77
line-length = 120
88
target-version = 'py38'
9+
10+
[tool.ruff.lint]
11+
# Enable preview rules.
12+
preview = true
13+
select = ["F401", "I"]
14+
15+
[tool.ruff.lint.isort]
16+
case-sensitive = false
17+
force-single-line = true
18+
from-first = true
19+
no-sections = true
20+
order-by-type = false
21+
required-imports = ["from __future__ import annotations"]

0 commit comments

Comments
 (0)