Skip to content

Commit

Permalink
Fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
avikstroem committed Jul 7, 2023
1 parent b998be6 commit 0165f2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/security_constraints/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def convert(obj: Any) -> Any:
return dataclasses.asdict(self, dict_factory=_dict_factory)

@classmethod
def from_dict(cls: type[Self], in_dict: dict[str, Any]) -> Self:
def from_dict(cls, in_dict: dict[str, Any]) -> Self:
kwargs: _ConfigurationKwargs = {}
if "ignore_ids" in in_dict:
kwargs["ignore_ids"] = set(in_dict["ignore_ids"])
Expand All @@ -158,14 +158,14 @@ def from_dict(cls: type[Self], in_dict: dict[str, Any]) -> Self:
return cls(**kwargs)

@classmethod
def from_args(cls: type[Self], args: ArgumentNamespace) -> Self:
def from_args(cls, args: ArgumentNamespace) -> Self:
return cls(
ignore_ids=set(args.ignore_ids),
min_severity=args.min_severity,
)

@classmethod
def merge(cls: type[Self], *config: Self) -> Self:
def merge(cls, *config: Self) -> Self:
"""Merge multiple Configurations into a new one."""
all_ignore_ids_entries = (c.ignore_ids for c in config)
all_min_severity_entries = (c.min_severity for c in config)
Expand All @@ -175,7 +175,7 @@ def merge(cls: type[Self], *config: Self) -> Self:
)

@classmethod
def supported_keys(cls: type[Self]) -> list[str]:
def supported_keys(cls) -> list[str]:
"""Return a list of keys which are supported in the config file."""
return list(cls().to_dict().keys())

Expand Down

0 comments on commit 0165f2f

Please sign in to comment.