songs1 commited on
Commit
6f75641
·
1 Parent(s): f50685c

update with precommit hooks

Browse files
Files changed (3) hide show
  1. .pre-commit-config.yaml +24 -0
  2. .secrets.baseline +131 -0
  3. hf-token-plugin.py +10 -0
.pre-commit-config.yaml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: git@github.com:Yelp/detect-secrets
3
+ rev: v1.5.0
4
+ hooks:
5
+ - id: detect-secrets
6
+ args: ['--baseline', '.secrets.baseline']
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v5.0.0
9
+ hooks:
10
+ - id: no-commit-to-branch
11
+ args: [--branch, main, --branch, master]
12
+ - repo: https://github.com/psf/black
13
+ rev: 24.10.0
14
+ hooks:
15
+ - id: black
16
+ - repo: https://github.com/pycqa/isort
17
+ rev: 5.13.2
18
+ hooks:
19
+ - id: isort
20
+ args: ["--profile", "black"]
21
+ - repo: https://github.com/kynan/nbstripout
22
+ rev: 0.8.1
23
+ hooks:
24
+ - id: nbstripout
.secrets.baseline ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "1.5.0",
3
+ "plugins_used": [
4
+ {
5
+ "name": "ArtifactoryDetector"
6
+ },
7
+ {
8
+ "name": "AWSKeyDetector"
9
+ },
10
+ {
11
+ "name": "AzureStorageKeyDetector"
12
+ },
13
+ {
14
+ "name": "Base64HighEntropyString",
15
+ "limit": 4.5
16
+ },
17
+ {
18
+ "name": "BasicAuthDetector"
19
+ },
20
+ {
21
+ "name": "CloudantDetector"
22
+ },
23
+ {
24
+ "name": "DiscordBotTokenDetector"
25
+ },
26
+ {
27
+ "name": "GitHubTokenDetector"
28
+ },
29
+ {
30
+ "name": "GitLabTokenDetector"
31
+ },
32
+ {
33
+ "name": "HexHighEntropyString",
34
+ "limit": 3.0
35
+ },
36
+ {
37
+ "name": "HuggingFaceTokenDetector",
38
+ "path": "file://hf-token-plugin.py"
39
+ },
40
+ {
41
+ "name": "IbmCloudIamDetector"
42
+ },
43
+ {
44
+ "name": "IbmCosHmacDetector"
45
+ },
46
+ {
47
+ "name": "IPPublicDetector"
48
+ },
49
+ {
50
+ "name": "JwtTokenDetector"
51
+ },
52
+ {
53
+ "name": "KeywordDetector",
54
+ "keyword_exclude": ""
55
+ },
56
+ {
57
+ "name": "MailchimpDetector"
58
+ },
59
+ {
60
+ "name": "NpmDetector"
61
+ },
62
+ {
63
+ "name": "OpenAIDetector"
64
+ },
65
+ {
66
+ "name": "PrivateKeyDetector"
67
+ },
68
+ {
69
+ "name": "PypiTokenDetector"
70
+ },
71
+ {
72
+ "name": "SendGridDetector"
73
+ },
74
+ {
75
+ "name": "SlackDetector"
76
+ },
77
+ {
78
+ "name": "SoftlayerDetector"
79
+ },
80
+ {
81
+ "name": "SquareOAuthDetector"
82
+ },
83
+ {
84
+ "name": "StripeDetector"
85
+ },
86
+ {
87
+ "name": "TelegramBotTokenDetector"
88
+ },
89
+ {
90
+ "name": "TwilioKeyDetector"
91
+ }
92
+ ],
93
+ "filters_used": [
94
+ {
95
+ "path": "detect_secrets.filters.allowlist.is_line_allowlisted"
96
+ },
97
+ {
98
+ "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
99
+ "min_level": 2
100
+ },
101
+ {
102
+ "path": "detect_secrets.filters.heuristic.is_indirect_reference"
103
+ },
104
+ {
105
+ "path": "detect_secrets.filters.heuristic.is_likely_id_string"
106
+ },
107
+ {
108
+ "path": "detect_secrets.filters.heuristic.is_lock_file"
109
+ },
110
+ {
111
+ "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
112
+ },
113
+ {
114
+ "path": "detect_secrets.filters.heuristic.is_potential_uuid"
115
+ },
116
+ {
117
+ "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
118
+ },
119
+ {
120
+ "path": "detect_secrets.filters.heuristic.is_sequential_string"
121
+ },
122
+ {
123
+ "path": "detect_secrets.filters.heuristic.is_swagger_file"
124
+ },
125
+ {
126
+ "path": "detect_secrets.filters.heuristic.is_templated_secret"
127
+ }
128
+ ],
129
+ "results": {},
130
+ "generated_at": "2025-07-14T18:02:12Z"
131
+ }
hf-token-plugin.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+
3
+ from detect_secrets.plugins.base import RegexBasedDetector
4
+
5
+
6
+ class HuggingFaceTokenDetector(RegexBasedDetector):
7
+ secret_type = "HuggingFace User Access Tokens" # pragma: allowlist secret
8
+ denylist = [
9
+ re.compile(r"hf_[A-Za-z]{34}"),
10
+ ]