-
Notifications
You must be signed in to change notification settings - Fork 140
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
[v0.42] Allow parsing code in CSV and querying using (Go) JQ #3022
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:v0.42 commit 5c393f8 Collapsed results for better readability
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.42 #3022 +/- ##
=======================================
Coverage 79.51% 79.51%
=======================================
Files 336 336
Lines 79201 79201
=======================================
Hits 62973 62973
Misses 13920 13920
Partials 2308 2308
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Work towards #2998
Description
Analyzing on-chain code, like MN contracts, in an ad-hoc fashion is quite elaborate: We already have analysis infrastructure in the linter, but a custom analyzer has to be implemented for each new query.
Add support to the existing
parse
tool to:For example, this allows finding all fields which have the name
id
oruuid
:parse -readCSV -jqAST '.. | objects | select(.Type == "FieldDeclaration") | .Identifier.Identifier | select(in({"id": null, "uuid": null}))' contracts.csv
This was useful for the task at hand, but we can maybe also "generalize" the feature and port it to the analysis framework / linter later. Also, I needed this primarily on v0.x to parse current pre-1.0 contracts, but will also port this to master.
master
branchFiles changed
in the Github PR explorer