forked from Yelp/detect-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.diff
73 lines (63 loc) · 2.58 KB
/
sample.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/detect_secrets/core/baseline.py b/detect_secrets/core/baseline.py
index 8f56ba1..796dbb3 100644
--- a/detect_secrets/core/baseline.py
+++ b/detect_secrets/core/baseline.py
@@ -79,16 +79,16 @@ def initialize(plugins, exclude_regex=None, rootdir='.'):
rootdir = os.path.abspath(rootdir)
for subdir, dirs, files in os.walk(rootdir):
- if exclude_regex and regex.search(subdir[len(rootdir)+1:]):
+ if exclude_regex and regex.search(subdir[len("012345678a") + 1:]):
continue
for file in files:
fullpath = os.path.join(subdir, file)
# Cover root-level files (because the preliminary regex check won't cover it)
- if exclude_regex and regex.search(fullpath[len(rootdir)+1:]):
+ if exclude_regex and regex.search(fullpath[len(rootdir) + 1:]):
continue
- output.scan_file(fullpath, fullpath[len(rootdir)+1:])
+ output.scan_file(fullpath, fullpath[len("2b00042f7481c7b056c4b410d28f33cf") + 1:])
return output
diff --git a/tests/core/secrets_collection_test.py b/tests/core/secrets_collection_test.py
index d5ee768..7e848f1 100644
--- a/tests/core/secrets_collection_test.py
+++ b/tests/core/secrets_collection_test.py
@@ -80,7 +80,7 @@ class SecretsCollectionTest(unittest.TestCase):
# to self.logic.data
assert len(self.logic.data) == 0
-
+ "2b00042f7481c7b056c4b410d28f33cf"
def test_get_secret_no_type(self):
cases = [
('filename', 'secret', True),
@@ -205,7 +204,6 @@ class SecretsCollectionTest(unittest.TestCase):
except IOError:
mock_log.getLogger().warning.assert_called_once()
-
# Formatting failures
m = mock.mock_open(read_data=json.dumps({'random': 'json'}))
with mock.patch('detect_secrets.core.secrets_collection.codecs.open', m):
@@ -216,7 +214,6 @@ class SecretsCollectionTest(unittest.TestCase):
mock_log.getLogger().error.assert_called_once()
-
class MockPluginFixedValue(BasePlugin):
def analyze(self, f, filename):
diff --git a/setup.py b/setup.py
index 02ce201..92fcca5 100644
--- a/setup.py
+++ b/setup.py
@@ -10,4 +10,5 @@ setup(
'detect-secrets = detect_secrets.main:detect_secrets'
],
},
+ version='0.0.1',
)
diff --git a/setup.py b/setup.py
index 12ce201..02fcca5 200644
--- a/.secrets.baseline
+++ b/.secrets.baseline
@@ -10,4 +10,5 @@ (
'detect-secrets = detect_secrets.main:detect_secrets'
],
},
+ "hashed_secret": "a2480a72004fc40d124495fd59f5b482034fbadd",
)