-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle CWE name #116
base: main
Are you sure you want to change the base?
Handle CWE name #116
Conversation
If that looks good to you, I'll update the other advisories. |
code/cwe/src/CWE.hs
Outdated
-- | A map to lookup CWE names. | ||
cweNames :: Map CWEID Text | ||
cweNames = Map.fromList (coerce cweData) | ||
|
||
-- | A map to lookup CWEID. | ||
cweIds :: Map Text CWEID | ||
cweIds = Map.fromList $ (\(k, v) -> (v, k)) <$> (coerce cweData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually I would like to add all the parent / child / category membership data as well. But this is good for now.
Thank you for the review @frasertweedale! I'll address the rest of the comments tomorrow. |
#!/usr/bin/env cabal | ||
{- cabal: | ||
build-depends: base, xml | ||
-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's unusual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's just for one-shot codegen I figured it was not necessary to add this to the cabal file.
fe63c09
to
f0f370f
Compare
261a833
to
013e031
Compare
This change adds a new library to parse CWE names.
This PR enables using CWE names instead of their number to improve advisory visibility.