Yelp / detect-secrets

An enterprise friendly way of detecting and preventing secrets in code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NotImplementedError when calling str on StatisticsAggregator

PaulCormier opened this issue · comments

This doesn't look like it will work:

print(str(stats))

aggregator = StatisticsAggregator()
for _, secret in secrets:
# TODO: gather real secrets?
# TODO: do we need repo_info?
aggregator.record_secret(secret)
return aggregator

def __str__(self) -> str:
raise NotImplementedError

Sure enough, running detect-secrets audit --stats .secrets.baseline:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\DevApps\Python\Python311\Scripts\detect-secrets.exe\__main__.py", line 7, in <module>
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\main.py", line 32, in main
    handle_audit_action(args)
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\main.py", line 131, in handle_audit_action
    print(str(stats))
          ^^^^^^^^^^
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\audit\analytics.py", line 61, in __str__
    raise NotImplementedError
NotImplementedError