-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Consider replacing Solhint with Slippy #5918
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
base: master
Are you sure you want to change the base?
Conversation
|
Reviewer's GuideThis PR replaces Solhint with Slippy by installing Slippy, introducing a detailed Slippy config, and updating code to satisfy its rules (unused-vars, named-return-params, naming-convention) via removals, parameter naming, and inline disable directives. Entity relationship diagram for linter configuration fileserDiagram
PACKAGE_JSON ||--o| SLIPPY_CONFIG : "uses"
SLIPPY_CONFIG {
string[] rules
string[] ignores
string[] files
}
PACKAGE_JSON {
string dependencies
}
Class diagram for updated ERC7579FallbackHandlerMock return paramsclassDiagram
class ERC7579FallbackHandlerMock {
+callView() : (address account, address sender)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughProject-wide linting integration: adds Slippy linter config/dependency and inserts suppression comments across contracts, mocks, and tests for naming conventions and related rules. Removes several unused imports. One function now uses named return parameters. A codegen template gains a matching lint directive. No runtime logic changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- The naming-convention rule is triggering a lot of per-line disables; consider adding pattern-based exceptions (e.g. for __.*_init or CLOCK_MODE/COUNTING_MODE functions) in slippy.config.js so you don’t need to sprinkle disable comments everywhere.
- Where possible, group slippy disables at the file or directory level (especially in tests or mocks) rather than on each line to cut down on noise and make the code more maintainable.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The naming-convention rule is triggering a lot of per-line disables; consider adding pattern-based exceptions (e.g. for __.*_init or CLOCK_MODE/COUNTING_MODE functions) in slippy.config.js so you don’t need to sprinkle disable comments everywhere.
- Where possible, group slippy disables at the file or directory level (especially in tests or mocks) rather than on each line to cut down on noise and make the code more maintainable.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Actionable comments posted: 1
🧹 Nitpick comments (25)
package.json (1)
67-67
: Wire Slippy into npm scripts/CI and ignore "slippy" in Codespell
- Add a
"lint:slippy": "slippy"
script in package.json and invoke it from your existinglint
andlint:sol
chains.- Extend your lint-staged config for
*.sol
to runslippy
after Solhint.- Create or update a Codespell config (e.g.
.codespellrc
or.codespellignore
) to whitelist “slippy” so CI checks no longer flag it.contracts/mocks/token/ERC20VotesAdditionalCheckpointsMock.sol (1)
29-29
: Place the suppression before the signature and use -next-line for clarity.Using
slippy-disable-previous-line
inside the body is easy to miss. Put it above the function with-next-line
alongside solhint for consistency.Apply within the selected line to remove the in-body directive:
- // slippy-disable-previous-line naming-convention
Then adjust above (outside selected lines):
// solhint-disable-next-line func-name-mixedcase // slippy-disable-next-line naming-convention function CLOCK_MODE() public view virtual override returns (string memory) {contracts/mocks/docs/governance/MyTokenTimestampBased.sol (1)
20-20
: Mirror the suppression placement pattern used elsewhere.Move the directive above the signature and switch to
-next-line
to make the intent unambiguous.Apply within the selected line to remove the in-body directive:
- // slippy-disable-previous-line naming-convention
Then adjust above (outside selected lines):
// solhint-disable-next-line func-name-mixedcase // slippy-disable-next-line naming-convention function CLOCK_MODE() public pure override returns (string memory) {contracts/vendor/compound/ICompoundTimelock.sol (1)
41-47
: Consistent suppression style (optional).Using inline
// slippy-disable-line naming-convention
is fine. For consistency with the preceding Solhint directive and to reduce line length noise, consider switching toslippy-disable-next-line
above each declaration.// solhint-disable-next-line func-name-mixedcase -function GRACE_PERIOD() external view returns (uint256); // slippy-disable-line naming-convention +// slippy-disable-next-line naming-convention +function GRACE_PERIOD() external view returns (uint256); // solhint-disable-next-line func-name-mixedcase -function MINIMUM_DELAY() external view returns (uint256); // slippy-disable-line naming-convention +// slippy-disable-next-line naming-convention +function MINIMUM_DELAY() external view returns (uint256); // solhint-disable-next-line func-name-mixedcase -function MAXIMUM_DELAY() external view returns (uint256); // slippy-disable-line naming-convention +// slippy-disable-next-line naming-convention +function MAXIMUM_DELAY() external view returns (uint256);contracts/mocks/Stateless.sol (1)
5-6
: Fix minor grammar; suppression placement is good.Change “just to we can run” → “just so we can run”. Optional: re-enable after imports to limit the disabled span.
-// We keep these imports and a dummy contract just to we can run the test suite after transpilation. +// We keep these imports and a dummy contract just so we can run the test suite after transpilation.Optional snippet (near the contract declaration):
// slippy-enable no-unused-vars
contracts/governance/utils/Votes.sol (1)
66-68
: Nit: prefer trailing disable on the signature for consistencyUse slippy-disable-line on the declaration itself (matches IGovernor style) and drop the body-line directive.
- function CLOCK_MODE() public view virtual returns (string memory) { - // slippy-disable-previous-line naming-convention + function CLOCK_MODE() public view virtual returns (string memory) { // slippy-disable-line naming-conventioncontracts/governance/extensions/GovernorCountingFractional.sol (1)
58-60
: Nit: inline the suppression on the signature for uniformityInline slippy-disable-line on the declaration and remove the extra line.
- function COUNTING_MODE() public pure virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention + function COUNTING_MODE() public pure virtual override returns (string memory) { // slippy-disable-line naming-conventioncontracts/mocks/VotesMock.sol (1)
39-41
: Nit: match the inline style used elsewhereMove the suppression to the function line.
- function CLOCK_MODE() public view virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention + function CLOCK_MODE() public view virtual override returns (string memory) { // slippy-disable-line naming-conventioncontracts/mocks/VotesExtendedMock.sol (1)
39-41
: Nit: adopt inline suppression for consistencyApply the trailing form and remove the extra comment line.
- function CLOCK_MODE() public view virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention + function CLOCK_MODE() public view virtual override returns (string memory) { // slippy-disable-line naming-conventioncontracts/governance/IGovernor.sol (1)
202-202
: Optional: centralize standard exceptions in Slippy configTo reduce scattered disable comments, consider allowlisting ERC-required identifiers (e.g., CLOCK_MODE, COUNTING_MODE, DOMAIN_SEPARATOR, __self) in slippy.config.js for function-name checks in contracts/mocks/tests.
contracts/utils/cryptography/EIP712.sol (2)
146-149
: Scope linter suppression to the signature line for consistencyInline the directive to reduce vertical noise and match usages elsewhere.
-// solhint-disable-next-line func-name-mixedcase -function _EIP712Name() internal view returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function _EIP712Name() internal view returns (string memory) { // slippy-disable-line naming-convention
158-161
: Same here: inline the naming suppression on the declarationKeeps style uniform with other files.
-// solhint-disable-next-line func-name-mixedcase -function _EIP712Version() internal view returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function _EIP712Version() internal view returns (string memory) { // slippy-disable-line naming-conventioncontracts/governance/extensions/GovernorCountingOverridable.sol (1)
52-55
: Prefer trailing // slippy-disable-line on the declarationMatches the intent (suppress rule for this signature only) and reduces clutter.
-// solhint-disable-next-line func-name-mixedcase -function COUNTING_MODE() public pure virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function COUNTING_MODE() public pure virtual override returns (string memory) { // slippy-disable-line naming-conventioncontracts/governance/extensions/GovernorVotes.sol (1)
45-47
: Inline the suppression on the signatureConsistent with other occurrences and avoids an extra line.
-// solhint-disable-next-line func-name-mixedcase -function CLOCK_MODE() public view virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function CLOCK_MODE() public view virtual override returns (string memory) { // slippy-disable-line naming-conventionscripts/generate/templates/Packing.js (1)
39-40
: Consider narrowing the disable or encoding it in configFile-wide disable is pragmatic for generated numeric-suffixed functions, but you could:
- Encode an allowlist pattern for pack_/extract_/replace_ names in slippy.config.js, or
- Prepend
// slippy-disable-next-line naming-convention
only before generated function declarations to limit scope.If you want, I can draft a config override targeting the generated Packing.sol path with a regex for these function names.
contracts/mocks/token/ERC20VotesTimestampMock.sol (2)
15-18
: Inline the suppression on the declarationFor consistency with other files.
-// solhint-disable-next-line func-name-mixedcase -function CLOCK_MODE() public view virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function CLOCK_MODE() public view virtual override returns (string memory) { // slippy-disable-line naming-convention
27-30
: Apply the same in the ERC721 variantKeep both variants styled the same way.
-// solhint-disable-next-line func-name-mixedcase -function CLOCK_MODE() public view virtual override returns (string memory) { - // slippy-disable-previous-line naming-convention +// solhint-disable-next-line func-name-mixedcase +function CLOCK_MODE() public view virtual override returns (string memory) { // slippy-disable-line naming-conventioncontracts/mocks/MultipleInheritanceInitializableMocks.sol (1)
30-30
: Directive placement looks correct; consider eliminating repeated disables via config.Using
// slippy-disable-previous-line naming-convention
immediately after the function header neatly targets the mixed-case init names, including the multi-line signature at Line 124. To reduce noise across many init helpers, consider adding a narrow exception in slippy.config.js for^__.*_init(_unchained)?$
function names in sources/mocks instead of per-callsite disables.I can draft a config override that whitelists only that pattern without loosening other rules.
Also applies to: 36-36, 53-53, 61-61, 77-77, 84-84, 101-101, 108-108, 125-125, 138-138
slippy.config.js (1)
77-87
: Consider scoping named-return-params to sources only.With
'named-return-params': 'error'
in the global block, tests/mocks also require naming. If that’s intentional, fine; otherwise move it to the sources block to cut test churn and comment directives.I can prepare a patch that enables it only for
contracts/**/*
while leaving tests/mocks unchanged.contracts/token/ERC20/extensions/ERC20Permit.sol (1)
75-75
: Scoped suppression for EIP-mandated name is fine; consider moving to config to avoid inline churn.The one-line disable is appropriate here. Optionally, add an allowlist pattern for
DOMAIN_SEPARATOR
in slippy.config.js (e.g., naming-convention exceptions for specific selectors) to remove inline comments across the repo.contracts/governance/Governor.sol (1)
795-795
: Consolidate inline linter disables and remove legacy Solhint directives
• Repo-wide, pick one Slippy disable form—e.g. replace all// slippy-disable-previous-line naming-convention
with// slippy-disable-line naming-convention
(currently both appear in contracts, extensions, mocks, and tests).
• Remove every// solhint-disable-*
directive (several leftovers in scripts, tests, and contracts) if Solhint is no longer part of the linting pipeline.contracts/governance/extensions/GovernorCountingSimple.sol (1)
33-33
: OK to suppress here; prefer config-based exceptions for COUNTING_MODE.Given COUNTING_MODE is part of a public API surface across multiple files, consider a config regex exception instead of per-site disables to keep sources clean.
test/governance/extensions/GovernorSuperQuorumGreaterThanQuorum.t.sol (3)
47-49
: Test helper naming suppression is reasonable; you can relax naming rules for tests in config.Add a tests-only override in slippy.config.js (pattern:
test/**
) allowing leading$
/underscores to avoid inline directives.
53-55
: Same as above for $_updateQuorumNumerator.Prefer a tests-scope naming exception over inline disables to reduce noise.
83-85
: Centralize naming-convention overrides in test config
- Configure Slippy to ignore
naming-convention
undertest/**
and remove the 5 inline// slippy-disable-(previous-line|line) naming-convention
directives.- Once Solhint is removed or scoped for tests, drop the adjacent
// solhint-disable-next-line
here.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (34)
contracts/account/extensions/draft-AccountERC7579.sol
(0 hunks)contracts/governance/Governor.sol
(1 hunks)contracts/governance/IGovernor.sol
(1 hunks)contracts/governance/extensions/GovernorCountingFractional.sol
(1 hunks)contracts/governance/extensions/GovernorCountingOverridable.sol
(1 hunks)contracts/governance/extensions/GovernorCountingSimple.sol
(1 hunks)contracts/governance/extensions/GovernorVotes.sol
(1 hunks)contracts/governance/utils/Votes.sol
(1 hunks)contracts/interfaces/IERC6372.sol
(1 hunks)contracts/mocks/MultipleInheritanceInitializableMocks.sol
(6 hunks)contracts/mocks/Stateless.sol
(1 hunks)contracts/mocks/VotesExtendedMock.sol
(1 hunks)contracts/mocks/VotesMock.sol
(1 hunks)contracts/mocks/account/AccountMock.sol
(0 hunks)contracts/mocks/account/modules/ERC7579Mock.sol
(1 hunks)contracts/mocks/docs/governance/MyTokenTimestampBased.sol
(1 hunks)contracts/mocks/governance/GovernorNoncesKeyedMock.sol
(0 hunks)contracts/mocks/token/ERC20BridgeableMock.sol
(1 hunks)contracts/mocks/token/ERC20VotesAdditionalCheckpointsMock.sol
(1 hunks)contracts/mocks/token/ERC20VotesTimestampMock.sol
(2 hunks)contracts/mocks/utils/cryptography/ERC7739Mock.sol
(0 hunks)contracts/proxy/utils/UUPSUpgradeable.sol
(1 hunks)contracts/token/ERC20/extensions/ERC20Permit.sol
(1 hunks)contracts/token/ERC20/extensions/IERC20Permit.sol
(1 hunks)contracts/utils/Packing.sol
(1 hunks)contracts/utils/cryptography/EIP712.sol
(2 hunks)contracts/utils/cryptography/signers/draft-ERC7739.sol
(0 hunks)contracts/vendor/compound/ICompoundTimelock.sol
(1 hunks)package.json
(1 hunks)scripts/generate/templates/Packing.js
(1 hunks)slippy.config.js
(1 hunks)test/account/utils/draft-ERC7579Utils.t.sol
(1 hunks)test/governance/Governor.t.sol
(1 hunks)test/governance/extensions/GovernorSuperQuorumGreaterThanQuorum.t.sol
(2 hunks)
💤 Files with no reviewable changes (5)
- contracts/mocks/governance/GovernorNoncesKeyedMock.sol
- contracts/account/extensions/draft-AccountERC7579.sol
- contracts/mocks/utils/cryptography/ERC7739Mock.sol
- contracts/utils/cryptography/signers/draft-ERC7739.sol
- contracts/mocks/account/AccountMock.sol
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-29T13:16:08.640Z
Learnt from: Amxx
PR: OpenZeppelin/openzeppelin-contracts#5904
File: contracts/mocks/crosschain/ERC7786RecipientMock.sol:12-14
Timestamp: 2025-08-29T13:16:08.640Z
Learning: In OpenZeppelin contracts, mock contracts (like ERC7786RecipientMock) don't require input validation such as zero-address checks in constructors, as they are only used for testing purposes in controlled environments.
Applied to files:
contracts/mocks/token/ERC20BridgeableMock.sol
🪛 GitHub Check: codespell
package.json
[failure] 67-67:
slippy ==> slippery
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: tests-foundry
- GitHub Check: tests
- GitHub Check: slither
- GitHub Check: coverage
- GitHub Check: halmos
🔇 Additional comments (15)
contracts/utils/Packing.sol (1)
36-36
: LGTM: file-wide naming-convention suppression for generated code.Appropriate for auto-generated mixedcase/underscored helpers; matches the existing solhint disable.
contracts/mocks/token/ERC20BridgeableMock.sol (1)
5-5
: Nice cleanup: removed unused ERC20 import.No behavior change; keeps the mock lean.
contracts/proxy/utils/UUPSUpgradeable.sol (1)
21-21
: LGTM: targeted naming suppression for __self.Keeps semantics intact and matches local convention for private immutables with double underscores.
contracts/interfaces/IERC6372.sol (1)
16-16
: LGTM: inline naming-convention suppression for CLOCK_MODE.No interface or runtime impact.
test/account/utils/draft-ERC7579Utils.t.sol (1)
8-8
: LGTM: added Slippy no-console suppression mirroring Solhint.Keeps test logging pragmas explicit.
contracts/governance/utils/Votes.sol (1)
67-67
: LGTM: appropriate Slippy suppression for ERC-6372 nameUsing slippy-disable-previous-line to exempt CLOCK_MODE from naming-convention is appropriate here.
contracts/governance/extensions/GovernorCountingFractional.sol (1)
59-61
: LGTM: suppression limited to the nonconforming COUNTING_MODE identifierThe localized Slippy disable is appropriate and keeps scope tight.
contracts/mocks/VotesMock.sol (1)
40-41
: LGTM: scoped suppression for CLOCK_MODELooks good; no behavioral impact.
contracts/mocks/VotesExtendedMock.sol (1)
40-42
: LGTM: minimal, localized disableOK to suppress naming rule for this ERC-style function.
contracts/governance/IGovernor.sol (1)
202-202
: LGTM: trailing suppression on declaration is clear and containedThe inline disable is the cleanest approach on interfaces.
contracts/mocks/account/modules/ERC7579Mock.sol (1)
80-82
: Named return params: ABI-safe and clearer.Good switch to named returns; no ABI change and it satisfies the linter rule.
slippy.config.js (2)
45-64
: Rule precedence: internal vs library-internal functions.You correctly forbid leading underscores for
internal library
functions (Lines 60-64) while requiring them for otherinternal
functions (Lines 53-57). Ensure Slippy applies the most specific rule last; keeping the library-specific rule after the general internal rule (as you have) should give the desired precedence.Run Slippy once on a representative library with an
internal
function named_foo
to confirm it’s flagged, while a non-libraryinternal
_foo
passes.
80-106
: Sanity-check rule enablement without options (id-denylist).
'id-denylist': 'error'
is enabled but no deny list is provided in this config. If Slippy expects an explicit list, this will be a no-op (or could error unexpectedly). Either configure denylisted ids or turn it off to avoid confusion.You can confirm behavior by running the linter once and checking whether any identifiers are reported without a configured list. I can help wire a minimal deny list if desired.
contracts/token/ERC20/extensions/IERC20Permit.sol (1)
89-89
: Targeted suppression is fine.Inline disable on
DOMAIN_SEPARATOR()
is appropriate given the mandated mixed-case name; no functional impact.test/governance/Governor.t.sol (1)
39-39
: Consistent, minimal suppressions for constant-style accessors.The per-line disables on
CLOCK_MODE
andCOUNTING_MODE
keep tests clean without broad exemptions.Also applies to: 42-42
selector: 'stateVariable', | ||
format: ['camelCase', 'UPPER_CASE'], | ||
modifiers: ['private', 'constant'], | ||
leadingUnderscore: 'forbid', | ||
}, | ||
// non-constant private state variables should have a leading underscore | ||
{ | ||
selector: 'stateVariable', | ||
format: ['camelCase', 'UPPER_CASE'], | ||
modifiers: ['private'], | ||
leadingUnderscore: 'require', | ||
}, |
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.
🛠️ Refactor suggestion
Resolve conflicting stateVariable rules (constant/private vs. private non-constant).
As written, private non-constant state vars can be UPPER_CASE
, and private constants allow camelCase
, which contradicts typical conventions and the comment intent. Tighten formats as below.
{
selector: 'stateVariable',
- format: ['camelCase', 'UPPER_CASE'],
+ format: ['UPPER_CASE'],
modifiers: ['private', 'constant'],
leadingUnderscore: 'forbid',
},
// non-constant private state variables should have a leading underscore
{
selector: 'stateVariable',
- format: ['camelCase', 'UPPER_CASE'],
+ format: ['camelCase'],
modifiers: ['private'],
leadingUnderscore: 'require',
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
selector: 'stateVariable', | |
format: ['camelCase', 'UPPER_CASE'], | |
modifiers: ['private', 'constant'], | |
leadingUnderscore: 'forbid', | |
}, | |
// non-constant private state variables should have a leading underscore | |
{ | |
selector: 'stateVariable', | |
format: ['camelCase', 'UPPER_CASE'], | |
modifiers: ['private'], | |
leadingUnderscore: 'require', | |
}, | |
{ | |
selector: 'stateVariable', | |
format: ['UPPER_CASE'], | |
modifiers: ['private', 'constant'], | |
leadingUnderscore: 'forbid', | |
}, | |
// non-constant private state variables should have a leading underscore | |
{ | |
selector: 'stateVariable', | |
format: ['camelCase'], | |
modifiers: ['private'], | |
leadingUnderscore: 'require', | |
}, |
🤖 Prompt for AI Agents
In slippy.config.js around lines 33 to 44, the two stateVariable rules conflict:
the private+constant rule allows camelCase and UPPER_CASE (but should only allow
UPPER_CASE for constants) and the private (non-constant) rule allows UPPER_CASE
(but should only allow camelCase). Update the formats so the private+constant
rule uses format: ['UPPER_CASE'] only, and the private (non-constant) rule uses
format: ['camelCase'] only, keeping leadingUnderscore: 'require' for the
non-constant private rule and leadingUnderscore: 'forbid' for the constant
private rule.
Hi, for the last couple of months I've been working on a new linter for Solidity, and I think it's already more flexible and powerful than Solhint: Slippy. This PR is meant to show how moving to Slippy would look like. I hope you consider doing it!
I split this PR into four commits:
no-unused-vars
rule. This rule is more powerful than Solhint's equivalent (it checks unused imports and unused private variables and functions) and more flexible (you can configure a pattern like "starts with underscore" to mark some variables as intentionally unused).named-return-params
rule.naming-convention
rule. This rule replaces the usage of multiple Solhint rules likeconst-name-snakecase
,contract-name-capwords
, etc. It also replaces OZ'sinterface-names
custom rule (which is redundant with Solhint'sinterface-starts-with-i
, but anyway). Most of the changes in this commit are related to adding equivalentslippy-disable-*
comments; the interesting changes are in the Slippy config themselves.Why Slippy
I wrote a detailed comparison with Solhint in the repo, but here are some highlights:
slippy.config.js
easily lets you configure some rules for every Solidity file, some for every non-mock and non-test file, and some only for test files. This is inspired by eslint's flat configuration files.no-unused-vars
rule. As mentioned above, this rule is both more powerful (catches more things) and lets you set naming patterns to mark as exceptions.naming-convention
rule lets you define whatever naming convention you want. I admit that its config is quite verbose in the case of OZ, given that it has a mix of Solhint rules and custom rules, but it also shows that it can be adapted to any convention, no matter how complex it is.// slippy-disable-*
comments. In OZ's case, I don't think you have any stale directives, but I've seen multiple projects that have// solhint-disable-*
that don't do anything.compatible-pragma
orno-uninitialized-immutable-references
.no-restricted-syntax
rule that lets you easily forbid patterns using Slang queries.Why not migrate
I also want to be honest about Slippy's current limitations:
--fix
. This is also high on my list of things to work on.naming-convention
andno-restricted-syntax
should make this less urgent.Summary by Sourcery
Replace Solhint with Slippy, updating dependencies, adding a flat Slippy configuration, and adjusting the codebase to adhere to Slippy’s no-unused-vars, named-return-params, and naming-convention rules.
New Features:
Enhancements:
Build:
Summary by CodeRabbit