diff --git a/capa/features/address.py b/capa/features/address.py index f0cbd77d29..45c3a600f9 100644 --- a/capa/features/address.py +++ b/capa/features/address.py @@ -10,8 +10,7 @@ class Address(abc.ABC): @abc.abstractmethod - def __eq__(self, other): - ... + def __eq__(self, other): ... @abc.abstractmethod def __lt__(self, other): diff --git a/capa/features/extractors/binexport2/__init__.py b/capa/features/extractors/binexport2/__init__.py index 95213434ca..8032b2fca0 100644 --- a/capa/features/extractors/binexport2/__init__.py +++ b/capa/features/extractors/binexport2/__init__.py @@ -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 diff --git a/capa/features/extractors/vmray/models.py b/capa/features/extractors/vmray/models.py index 3515b2427a..c2d6551aa0 100644 --- a/capa/features/extractors/vmray/models.py +++ b/capa/features/extractors/vmray/models.py @@ -189,8 +189,7 @@ class GenericReference(BaseModel): source: str -class StaticDataReference(GenericReference): - ... +class StaticDataReference(GenericReference): ... class PEFileBasicInfo(BaseModel): diff --git a/capa/ida/plugin/form.py b/capa/ida/plugin/form.py index 40a2181d61..54bd704090 100644 --- a/capa/ida/plugin/form.py +++ b/capa/ida/plugin/form.py @@ -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) diff --git a/capa/render/result_document.py b/capa/render/result_document.py index fe2c9e2c19..8aece5c9c9 100644 --- a/capa/render/result_document.py +++ b/capa/render/result_document.py @@ -159,8 +159,7 @@ class CompoundStatementType: OPTIONAL = "optional" -class StatementModel(FrozenModel): - ... +class StatementModel(FrozenModel): ... class CompoundStatement(StatementModel): @@ -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 = {