Skip to content

Commit

Permalink
black reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Dec 3, 2024
1 parent a5df028 commit 4103b10
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions capa/features/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

class Address(abc.ABC):
@abc.abstractmethod
def __eq__(self, other):
...
def __eq__(self, other): ...

@abc.abstractmethod
def __lt__(self, other):
Expand Down
6 changes: 2 additions & 4 deletions capa/features/extractors/binexport2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,10 @@ def contains(self, address: int) -> bool:
return self.address <= address < self.end


class ReadMemoryError(ValueError):
...
class ReadMemoryError(ValueError): ...


class AddressNotMappedError(ReadMemoryError):
...
class AddressNotMappedError(ReadMemoryError): ...


@dataclass
Expand Down
3 changes: 1 addition & 2 deletions capa/features/extractors/vmray/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ class GenericReference(BaseModel):
source: str


class StaticDataReference(GenericReference):
...
class StaticDataReference(GenericReference): ...


class PEFileBasicInfo(BaseModel):
Expand Down
6 changes: 3 additions & 3 deletions capa/ida/plugin/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,9 @@ def get_ask_use_persistent_cache(self, analyze):
update_wait_box("verifying cached results")

try:
results: Optional[
capa.render.result_document.ResultDocument
] = capa.ida.helpers.load_and_verify_cached_results()
results: Optional[capa.render.result_document.ResultDocument] = (
capa.ida.helpers.load_and_verify_cached_results()
)
except Exception as e:
capa.ida.helpers.inform_user_ida_ui("Failed to verify cached results, reanalyzing program")
logger.exception("Failed to verify cached results (error: %s)", e)
Expand Down
9 changes: 4 additions & 5 deletions capa/render/result_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ class CompoundStatementType:
OPTIONAL = "optional"


class StatementModel(FrozenModel):
...
class StatementModel(FrozenModel): ...


class CompoundStatement(StatementModel):
Expand Down Expand Up @@ -649,9 +648,9 @@ def from_capa(cls, meta: Metadata, rules: RuleSet, capabilities: MatchResults) -
return ResultDocument(meta=meta, rules=rule_matches)

def to_capa(self) -> tuple[Metadata, dict]:
capabilities: dict[
str, list[tuple[capa.features.address.Address, capa.features.common.Result]]
] = collections.defaultdict(list)
capabilities: dict[str, list[tuple[capa.features.address.Address, capa.features.common.Result]]] = (
collections.defaultdict(list)
)

# this doesn't quite work because we don't have the rule source for rules that aren't matched.
rules_by_name = {
Expand Down

0 comments on commit 4103b10

Please sign in to comment.