Skip to content

Commit

Permalink
refactor(schema): simplify prefix validation regex
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andrewpollock committed Sep 12, 2024
1 parent 3ab86b6 commit 800f207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"type": "string",
"title": "Currently supported ecosystems",
"description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field",
"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:]]+)?"
"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]+)?"
},
"prefix": {
"type": "string",
Expand Down

0 comments on commit 800f207

Please sign in to comment.