Skip to content

Commit

Permalink
Fix pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Oct 3, 2022
1 parent 16393d5 commit be9199e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions slither/tools/doctor/checks/platform.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from pathlib import Path

import crytic_compile.crytic_compile as crytic_compile
from crytic_compile import crytic_compile

from slither.tools.doctor.utils import snip_section
from slither.utils.colors import red, yellow, green
Expand Down Expand Up @@ -54,6 +54,6 @@ def compile_project(project: str, **kwargs):

try:
crytic_compile.CryticCompile(project, **kwargs)
except Exception as e:
except Exception as e: # pylint: disable=broad-except
with snip_section("Project compilation failed :( The following error was generated:"):
logging.exception(e)
7 changes: 4 additions & 3 deletions slither/tools/doctor/checks/versions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from importlib import metadata
import json
from typing import Optional
from packaging.version import parse, LegacyVersion, Version
import urllib

from packaging.version import parse, LegacyVersion, Version

from slither.utils.colors import yellow, green


Expand All @@ -22,11 +23,11 @@ def get_github_version(name: str) -> Optional[LegacyVersion | Version]:
text = response.read()
data = json.loads(text)
return parse(data["tag_name"])
except:
except: # pylint: disable=bare-except
return None


def show_versions(**kwargs) -> None:
def show_versions(**_kwargs) -> None:
versions = {
"Slither": (get_installed_version("slither-analyzer"), get_github_version("slither")),
"crytic-compile": (
Expand Down
2 changes: 1 addition & 1 deletion slither/tools/doctor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def report_section(title: str) -> None:
print(bold(f"## {title}"), end="\n\n")
try:
yield
except Exception as e:
except Exception as e: # pylint: disable=broad-except
with snip_section(
"slither-doctor failed unexpectedly! Please report this on the Slither GitHub issue tracker, and include the output below:"
):
Expand Down

0 comments on commit be9199e

Please sign in to comment.