Skip to content

Commit 9798e57

Browse files
committed
Format
1 parent 2a25515 commit 9798e57

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

slither_lsp/app/logging/lsp_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class LSPHandler(Handler):
1616
"""
1717
Forwards log messages to the LSP client
1818
"""
19+
1920
def __init__(self, server: LanguageServer):
2021
Handler.__init__(self)
2122
self.server = server

slither_lsp/app/request_handlers/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def to_pos(pos: lsp.Position) -> Pos:
1919

2020

2121
def to_range(range: lsp.Range) -> Range:
22-
return (to_pos(range.start), to_pos(range.end))
22+
return (to_pos(range.start), to_pos(range.end))

slither_lsp/app/slither_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
from slither_lsp.app.utils.file_paths import normalize_uri, uri_to_fs_path
5050

5151
# TODO(frabert): Maybe this should be upstreamed? https://github.com/openlawlibrary/pygls/discussions/338
52-
METHOD_TO_OPTIONS[lsp.WORKSPACE_DID_CHANGE_WATCHED_FILES] = (
53-
lsp.DidChangeWatchedFilesRegistrationOptions
54-
)
52+
METHOD_TO_OPTIONS[
53+
lsp.WORKSPACE_DID_CHANGE_WATCHED_FILES
54+
] = lsp.DidChangeWatchedFilesRegistrationOptions
5555

5656

5757
class SlitherProtocol(LanguageServerProtocol):

slither_lsp/app/utils/file_paths.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def is_solidity_file(path: str) -> bool:
88
filename_base, file_extension = os.path.splitext(path)
9-
return file_extension is not None and file_extension.lower() == '.sol'
9+
return file_extension is not None and file_extension.lower() == ".sol"
1010

1111

1212
def uri_to_fs_path(uri: str) -> str:
@@ -19,7 +19,7 @@ def normalize_uri(uri: str) -> str:
1919

2020

2121
def fs_path_to_uri(path: str) -> str:
22-
uri = urljoin('file:', pathname2url(path))
22+
uri = urljoin("file:", pathname2url(path))
2323
return uri
2424

2525

@@ -41,10 +41,8 @@ def get_solidity_files(folders: Iterable[str], recursive=True) -> Set[str]:
4141
solidity_files.add(full_path)
4242
elif recursive and os.path.isdir(full_path):
4343
# If recursive, join our set with any other discovered files in subdirectories.
44-
if item != 'node_modules':
45-
solidity_files.update(
46-
get_solidity_files([full_path], recursive)
47-
)
44+
if item != "node_modules":
45+
solidity_files.update(get_solidity_files([full_path], recursive))
4846

4947
# Return all discovered solidity files
5048
return solidity_files

slither_lsp/app/utils/ranges.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def source_to_location(source: Source) -> lsp.Location:
4848
)
4949

5050

51-
def get_object_name_range(obj: Union[Function, Contract, Enum, Event, Structure], comp: CryticCompile) -> lsp.Range:
51+
def get_object_name_range(
52+
obj: Union[Function, Contract, Enum, Event, Structure], comp: CryticCompile
53+
) -> lsp.Range:
5254
name_pos = get_definition(obj, comp)
5355
return lsp.Range(
5456
start=lsp.Position(

0 commit comments

Comments
 (0)