Skip to content

Commit 800f207

Browse files
committed
refactor(schema): simplify prefix validation regex
Annoying yak shave: - I have an ecosystem cross-reference unit test for osv.dev in the works, which relies on using the regex in the schema definition, verbatim. - [Python 3.7 has a FutureWarning on set constructs](https://docs.python.org/dev/whatsnew/3.7.html#re), where as far as I can tell, `(:[[:digit:]]+)?` would need to be written as `(:\[[:digit:]]+)?`, which isn't valid in the JSON Schema (more in python/cpython#74534) Signed-off-by: Andrew Pollock <apollock@google.com>
1 parent 3ab86b6 commit 800f207

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎validation/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
"type": "string",
301301
"title": "Currently supported ecosystems",
302302
"description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field",
303-
"pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|openSUSE|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu)(:[[:digit:]]+)?"
303+
"pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|openSUSE|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu)([0-9]+)?"
304304
},
305305
"prefix": {
306306
"type": "string",

0 commit comments

Comments
 (0)