We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 solhint rule to enforce the following recommendation from the Chainlink contracts style guide:
Structs should be constructed with named arguments. This prevents accidental assignment to the wrong field and makes the code more readable. // Good function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external { config = Config({ foo: _foo, bar: _bar, baz: _baz }); } // Bad function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external { config = Config(_foo, _bar, _baz); }
Structs should be constructed with named arguments. This prevents accidental assignment to the wrong field and makes the code more readable.
// Good function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external { config = Config({ foo: _foo, bar: _bar, baz: _baz }); } // Bad function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external { config = Config(_foo, _bar, _baz); }
https://github.com/smartcontractkit/chainlink/blob/3a74dc13b2d42316803b26b2254caa12f7beccb4/contracts/STYLE_GUIDE.md?plain=1#L389
STYLE_GUIDE.md
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Add a solhint rule to enforce the following recommendation from the Chainlink contracts style guide:
https://github.com/smartcontractkit/chainlink/blob/3a74dc13b2d42316803b26b2254caa12f7beccb4/contracts/STYLE_GUIDE.md?plain=1#L389
Steps
STYLE_GUIDE.md
to reference the new ruleThe text was updated successfully, but these errors were encountered: