Comments (5)
Thanks @dgzlopes! 👍 🎈 🎉 🎂
from detect-secrets.
Hello! I don't understand why the IGNORED_FILE_EXTENSIONS structure should change from a tuple to a dict. Could you offer some more insight on this?
On the other side, I made this quick fix dgzlopes@3828be9 on my fork (handling the check inside scan_file() instead of _extract_secrets_from_file()) and seems to work ok. Any idea on where to handle it more gently?
from detect-secrets.
The reason why I would like to change it to a dict
is because the only use is an in
check, which is faster in a hash table (dictionary). It's less for performance reasons and more for knowing how it is used, from seeing the type.
from detect-secrets.
Oh! I see. On the other hand (and sorry if this question is stupid) why we can't use a Set()?
They have both the same time complexity (O(1) for membership checking on the average case [0]) and both are implemented with a Hashtable. Also our file extensions values fit in one dimension [1], are unique and can be unordered. Also the Python docs [3] states that they are a good option for membership testing.
[0] https://wiki.python.org/moin/TimeComplexity#set
[1] https://stackoverflow.com/questions/19454970/is-there-a-python-dict-without-values
[2] https://docs.python.org/3/library/stdtypes.html#set
from detect-secrets.
Oh, I wasn't clear, I did mean set.
e.g. replacing the (
with {
and )
with }
A dictionary without keys is a set, so I kind of used them interchangeably.
from detect-secrets.
Related Issues (20)
- brew missing dependencies HOT 3
- UI improvement: Wording of audit prompt is confusing HOT 3
- False positive detection of Git revision hash as high entropy string in `pyproject.toml` HOT 3
- Detection of telegram bot API-keys
- Fix README so copy/paste works HOT 1
- Supported languages? HOT 3
- Secret followed by type hint are not detected
- Secrets are not found in Jupyter Notebooks HOT 1
- validity checking of detected secrets ? HOT 5
- Detect a npmrc auth token being checked in HOT 1
- Problem with Python3.11 and pre-commit HOT 4
- False Negative - YAML Parser Stops Reading After First String Value/Does Not Read Lists of Strings
- Getting detect-secrets: command not found error HOT 3
- Request: using a baseline as an allowlist HOT 5
- Pre-commit hook fails with "error: Unable to read baseline." HOT 1
- Reddit HOT 1
- Request: Push a new tag HOT 3
- Bug file with just `APEOptState` seems to be breaking `detect-secrets[word_list]==1.5.0` HOT 1
- detect-secrets-hook read file list from a file, to allow use of exit code HOT 2
- KeywordDetector plugin doesn't detect secrets which start with a symbol
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detect-secrets.