Ignore glTF & JPEG XL files (#3325)

* feat: ignore glTF files

Inspired by https://github.com/gitleaks/gitleaks/issues/1526

* feat: ignore JPEG XL

* feat: ignore .avifs in addition to .avif
This commit is contained in:
Richard Gomez
2024-09-24 08:00:02 -07:00
committed by GitHub
parent e96c8e2f0a
commit b2311b4ad2
+23 -17
View File
@@ -9,23 +9,25 @@ var (
KB, MB, GB, TB, PB = 1e3, 1e6, 1e9, 1e12, 1e15 KB, MB, GB, TB, PB = 1e3, 1e6, 1e9, 1e12, 1e15
ignoredExtensions = map[string]struct{}{ ignoredExtensions = map[string]struct{}{
// images // images
"apng": {}, "apng": {},
"avif": {}, "avif": {},
"bmp": {}, "avifs": {},
"dia": {}, // Open-source Visio clone "bmp": {},
"gif": {}, "dia": {}, // Open-source Visio clone
"icns": {}, // Apple icon image file "gif": {},
"ico": {}, // Icon file "icns": {}, // Apple icon image file
"jpg": {}, "ico": {}, // Icon file
"jpeg": {}, "jpg": {},
"png": {}, "jpeg": {},
"svg": {}, "jxl": {},
"svgz": {}, // Compressed Scalable Vector Graphics file "png": {},
"tga": {}, "svg": {},
"tif": {}, "svgz": {}, // Compressed Scalable Vector Graphics file
"tiff": {}, "tga": {},
"vsdx": {}, // Microsoft Visio drawing file "tif": {},
"vsix": {}, // Visual Studio extension file "tiff": {},
"vsdx": {}, // Microsoft Visio drawing file
"vsix": {}, // Visual Studio extension file
// audio // audio
"fev": {}, // video game audio "fev": {}, // video game audio
@@ -69,6 +71,10 @@ var (
"ttf": {}, // TrueType font "ttf": {}, // TrueType font
"woff": {}, // Web Open Font Format "woff": {}, // Web Open Font Format
"woff2": {}, // Web Open Font Format 2 "woff2": {}, // Web Open Font Format 2
// misc
"glb": {}, // 3d models (binary)
"gltf": {}, // 3d models (JSON/ASCII)
} }
binaryExtensions = map[string]struct{}{ binaryExtensions = map[string]struct{}{