diff --git a/.gitignore b/.gitignore index 36e4d090..42b98cd1 100644 --- a/.gitignore +++ b/.gitignore @@ -116,6 +116,9 @@ virt/ # mypy .mypy_cache/ +# ruff +.ruff_cache + # log cert_processing_log.txt ./cc_processing_log.txt @@ -124,4 +127,4 @@ cert_processing_log.txt notebooks/cc/results/ # Default directory for dataset -/dataset \ No newline at end of file +/dataset diff --git a/src/sec_certs/dataset/dataset.py b/src/sec_certs/dataset/dataset.py index 711d3592..b2582046 100644 --- a/src/sec_certs/dataset/dataset.py +++ b/src/sec_certs/dataset/dataset.py @@ -53,9 +53,6 @@ class DatasetInternalState(ComplexSerializableType): auxiliary_datasets_processed: bool = False certs_analyzed: bool = False - def __bool__(self): - return any(vars(self)) - def __init__( self, certs: dict[str, CertSubType] = {}, diff --git a/src/sec_certs/sample/certificate.py b/src/sec_certs/sample/certificate.py index bb49c0df..5dab9cef 100644 --- a/src/sec_certs/sample/certificate.py +++ b/src/sec_certs/sample/certificate.py @@ -25,6 +25,9 @@ class References(ComplexSerializableType): directly_referencing: set[str] | None = field(default=None) indirectly_referencing: set[str] | None = field(default=None) + def __bool__(self): + return any(getattr(self, x) for x in vars(self)) + class Heuristics: cpe_matches: set[str] | None