Skip to content

Commit d46c5cc

Browse files
committed
Fix pylint
1 parent 9798e57 commit d46c5cc

File tree

17 files changed

+74
-118
lines changed

17 files changed

+74
-118
lines changed

.github/workflows/pylint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
run: |
3838
mkdir -p .github/linters
3939
cp pyproject.toml .github/linters
40+
pip install .
4041
4142
- name: Register pylint problem matcher
4243
run: |

pyproject.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,22 @@ slither-lsp = "slither_lsp.__main__:main"
4040
max-line-length = 120
4141

4242
disable = """
43-
import-outside-toplevel,
4443
missing-module-docstring,
45-
useless-return,
46-
duplicate-code
44+
missing-class-docstring,
45+
missing-function-docstring,
46+
unnecessary-lambda,
47+
cyclic-import,
48+
line-too-long,
49+
invalid-name,
50+
fixme,
51+
too-many-return-statements,
52+
too-many-ancestors,
53+
logging-fstring-interpolation,
54+
logging-not-lazy,
55+
duplicate-code,
56+
import-error,
57+
unsubscriptable-object,
58+
unnecessary-lambda-assignment,
59+
too-few-public-methods,
60+
too-many-instance-attributes
4761
"""

slither_lsp/app/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from importlib.metadata import version as pkg_version
22
from logging import Logger
33

4-
import slither_lsp.app.request_handlers as request_handlers
54
import slither_lsp.app.types.params as slsp
5+
from slither_lsp.app import request_handlers
66
from slither_lsp.app.slither_server import SlitherServer
77

88

slither_lsp/app/feature_analyses/slither_diagnostics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def clear(self) -> None:
136136
:return: None
137137
"""
138138
# Loop through all diagnostic files, publish new diagnostics for each file with no items.
139-
for file_uri in self.diagnostics.keys():
139+
for file_uri, _ in self.diagnostics:
140140
self._clear_single(file_uri, False)
141141

142142
# Clear the dictionary

slither_lsp/app/request_handlers/analysis/get_detector_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from typing import Any
1+
# pylint: disable=unused-argument
22

33
from pygls.server import LanguageServer
44
from slither.__main__ import get_detectors_and_printers, output_detectors_json
55

66

7-
def get_detector_list(ls: LanguageServer, params: Any) -> Any:
7+
def get_detector_list(ls: LanguageServer, params):
88
"""
99
Handler which invokes slither to obtain a list of all detectors and some properties that describe them.
1010
"""

slither_lsp/app/request_handlers/analysis/get_version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# pylint: disable=unused-argument
2+
13
from importlib.metadata import version as pkg_version
2-
from typing import Any
34

45
from pygls.server import LanguageServer
56

67

7-
def get_version(ls: LanguageServer, params: Any) -> Any:
8+
def get_version(ls: LanguageServer, params):
89
"""
910
Handler which retrieves versions for slither, crytic-compile, and related applications.
1011
"""

slither_lsp/app/request_handlers/call_hierarchy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def on_prepare_call_hierarchy(
7070
"offset": offset,
7171
},
7272
)
73-
return [elem for elem in res.values()]
73+
return list(res.values())
7474

7575

7676
def register_on_get_incoming_calls(ls: "SlitherServer"):
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from .autogenerate_standard_json import autogenerate_standard_json
21
from .get_command_line_args import get_command_line_args

slither_lsp/app/request_handlers/compilation/autogenerate_standard_json.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

slither_lsp/app/request_handlers/compilation/get_command_line_args.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
# pylint: disable=protected-access, unused-argument
2+
13
from argparse import ArgumentParser
2-
from typing import Any
34

45
from crytic_compile.cryticparser.cryticparser import init as crytic_parser_init
56
from pygls.server import LanguageServer
67

78

8-
def get_command_line_args(ls: LanguageServer, params: Any) -> Any:
9+
def get_command_line_args(ls: LanguageServer, params):
910
"""
1011
Handler which obtains data regarding all command line arguments available in crytic-compile.
1112
"""

0 commit comments

Comments
 (0)