-
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
Add a custom linter which detects Value composite literals #1481
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1481 +/- ##
==========================================
- Coverage 73.01% 73.00% -0.01%
==========================================
Files 288 288
Lines 39786 39786
==========================================
- Hits 29048 29046 -2
- Misses 9263 9265 +2
Partials 1475 1475
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 3ecb20d 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.
Looks good to me.
I assume that like the other linters this will not run on test files, but for this one I think we should also disable it in value.go
so that we don't need to add lint ignore comments all over the place.
@dsainati1 yes, the linter is disabled for test files: https://github.com/onflow/cadence/pull/1481/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9R28
The linter is not enabled (yet) by default, but once we are done with the metering, there should only be very few cases where we, because we should always use the metering/non-metering constructor functions instead of constructing values using a composite literal. |
Work towards https://github.com/dapperlabs/cadence-private-issues/issues/2
Description
Add a new linter which detects composite literals for
Value
s.It is not enabled by default and can be run using:
make lint linters=constructorcheck
master
branchFiles changed
in the Github PR explorer