Yelp / detect-secrets

An enterprise friendly way of detecting and preventing secrets in code.
Apache License 2.0
3.76k stars 467 forks source link

Pre-commit hook fails with "error: Unable to read baseline." #799

Closed L0uisc closed 6 months ago

L0uisc commented 6 months ago

usage: detect-secrets-hook.EXE [-h] [-v] [--version] [-C ] [-c NUM_CORES] [--json] [--baseline FILENAME] [--list-all-plugins] [-p PLUGIN] [--base64-limit [BASE64_LIMIT]] [--hex-limit [HEX_LIMIT]] [--disable-plugin DISABLE_PLUGIN] [-n | --only-verified] [--exclude-lines EXCLUDE_LINES] [--exclude-files EXCLUDE_FILES] [--exclude-secrets EXCLUDE_SECRETS] [-f FILTER] [--disable-filter DISABLE_FILTER] [filenames ...] error: Unable to read baseline.



* **What is the expected behavior?**
* Commit succeeds since no new secrets are added.

* **What is the motivation / use case for changing the behavior?**
* The tool is unusable as it is now.

* **Please tell us about your environment:**
  - detect-secrets Version: 1.4.0
  - Python Version: 3.11.7
  - OS Version: Microsoft Windows 10 Business version 10.0.19045 Build 19045.
  - File type (if applicable): secrets baseline file
[secrets.baseline.txt](https://github.com/Yelp/detect-secrets/files/14554834/secrets.baseline.txt) (renamed to allow upload to github).

* **Other information**
<!-- (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. Stack Overflow, gitter etc.). If you have or can produce a baseline file, please provide it as part of a separate comment. -->
L0uisc commented 6 months ago

File encoding was UTF-16 BOM. Converted to UTF-8 and fixed the issue.