Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Show prevalence of rules in the output #1737
base: master
Are you sure you want to change the base?
Show prevalence of rules in the output #1737
Changes from 37 commits
7603f85
f5b38d5
bf1f59b
31bd6b3
9ca4f9d
78877f2
f5f3e87
a6797de
0b5a326
def2d98
039fdbd
8a0e61b
f6058b1
dc399c3
c5302cd
430bde6
7f1566d
24541b6
6787555
7c84926
c1f9e72
7d6ec15
5c1464c
8ede526
4476b2c
6077e99
bc0d129
12dea73
3bce5a9
5a0a3a5
e4bb521
fe4af5c
95bdf5d
af57da8
8057a73
5102ca1
07553a6
2c4931d
c531a15
61e7459
66d0ab7
e3ca32b
f084040
b07d600
10d2140
9bebffc
fa89f44
d93f135
08ea4a9
7992b1b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
while we're at it, is it worth defining a pydantic data model for the DB file/format?
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.
looks like the format is
dict[rule name, prevalence]
which will be hard to represent in pydantic, unless we enumerate all the rule names as potential values. i think the type hint above is a good start. still, adding some comments here showing a snippet of the file would be valuable.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.
is the rule prevalence database distributed with capa the library? i think its important that people be able to use capa the library without maintaining this database. so perhaps we want to handle the case of the database not existing here?
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.
In case database is not present, all rule matches will have prevalence as
unknown
in the results.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.
maybe we can provide a warning if no db is found (in case that's not already there) pointing to one and explaining shortly what it does