-
Notifications
You must be signed in to change notification settings - Fork 569
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
add capafmt utility for consistent formatting of rules #8
Comments
concern: a linter that reformats rules and may re-order lines probably doesn't handle block comments very well, e.g.:
we should try to avoid using implicit ordering like this in our rules. if we need to group comments, maybe we should do:
although in this case, the inner similar problem for sequences of comments, like:
i wonder if comments even get extracted into the AST... |
Great point! I would even prefer additional whitespace in subpoints:
I'd vote against using |
i agree. lets punt on supporting comments like this unless they become critical for some reason. maybe it won't actually be a problem. |
i also like the additional indentation in lists. need to do some research into how to tweak the pyyaml serialization. yaml/pyyaml#234 |
pyyaml completely drops inline comments during deserialization. we currently have 175 inline comments in our rules. see mandiant/capa-rules#1 we could use ruamel.yaml instead which tries to maintain comments. is this a losing battle? |
I think it's worthwhile keeping these comments to document and further enrich rules. I haven't looked into what this entails, but let's try to strike a good balance between implementation workload and provided benefit. |
it would be nice to format rules with a consistent style.
this includes:
meta
beforefeatures
by default, python yaml emits keys alphabetically. as an example:
this wold look nicer:
The text was updated successfully, but these errors were encountered: