- New Rule: Imports order #593
func-named-parameters
exclude abi.encodeX from the rule #583 (Thanks to @0xCLARITY)- Several typos in comments #586 (Thanks to @dropbigfish)
- New Rule: Imports order #587
Fixed an issue on the returining values where only was evaluating the first report instead of all of them.
Solhint changed how the exit codes are implemented:
Exit with 0 code
When execution was ok and there were no errors when evaluating the code according to the rules
Exit with 1 code
When execution was ok and there are errors reported
Exit with 1 code
When execution was ok and max warnings is lower than the reported warnings
Exit with 255 code
When there's an error in the execution (bad config, writing not allowed, wrong parameter, file not found, etc)
QUIET mode (-c quiet) option now works with the warnings and may exit with 1 if there are more than defined by user
Thanks to @juanpcapurro for providing the code
- Update Readme file to include all autofix rules
- Update docker file
- Update package json file
- Update dependencies in package json #548
- Custom errors rules checks from 0.8.4 forward before warning #555
- Parser support up to Solidity 0.8.22 (*)
(*) Note: Solhint can work with latest Solidity versions. If new grammar/syntax is added or changed, it could give some false positives or miss a rule. But overall functionality will work as expected.
- New Rule: Interface starts with
i
#557
- New Rule: [GC] Mutlitoken1155 rule #541
- New Rule: [GC] Small strings check #542
- New Rule: [GC] Indexed events #543
- New Rule: [GC] Calldata parameters #544
- New Rule: [GC] Increment by one #545
- New Rule: [GC] Struct packing #546
- New Rule: [GC] Name Return Values #552
- New Rule: [GC] Custom Errors #553 #555
- New Rule: [GC] Dot Length in Loops #559
- New Rule: [GC] Gas Strict Inequalities #560
named-return-values
rule was renamed to gas-named-return-values and now it is part of Gas Consumption ruleset #552custom-errors
rule was renamed to gas-custom-errors and now it is part of Gas Consumption ruleset #553- Return error 0 when executed correctly #554
- Default severity modified to
WARN
instead ofOFF
forfoundry-test-functions
andnamed-parameters-mapping
rules #556
- Fix changelog typos
- Official Docker Image #524 (Thanks to @keypee)
- Autofix for
payable-fallback
rule #528 - Autofix for
quotes
rule #529 - Autofix for
avoid-suicide
rule #531 - Autofix for
contract-name-camelcase
rule #532 - Autofix for
event-name-camelcase
rule #533
- Fix private vars leading underscore on libraries #525
- Enhance explicit types sensitivity #493 (Thanks to @vladyan18)
- Docs on
private-vars-leading-underscore
rule to clarify its functionality - Changelog and docs for
no-empty-blocks
rule to clarify its functionality - Require package with full path #515 (Thanks to @zouguangxian)
- Check for updates on Solhint version to keep users up to date. There's an option to disable this check (
--disc
) #506 fix
option now shows the report on screen #509save
option to store report on disk with the standard or the specified format #509- Autofix for
explicit-types
rule #504 - Autofix for
no-console
rule #513 - Autofix for
private-vars-leading-underscore
rule #511
- Generate docs script on Windows OS #494 (Thanks to @vladyan18)
one-contract-per-file
ignore interfaces #514 (Thanks to @cruzdanilo)
- New Rule:
one-contract-per-file
- Enforces the use of ONE contract per file #487
foundry-test-functions
- Modified regex to include invariant and statefulFuzz tests #484quotes
- To allow quotes inside double quotes and viceversa #485JSON
- Formatter returning JS object instead of standard json #490
- RULE:
not-rely-on-time
was REMOVED from RECOMMENDED ruleset
This was long overdue.
Beware!! If you are relying on this rule and it is not explicitly configured (meaning there's onlysolhint:recommended
option).
You should add this rule manually:
{
"extends": "solhint:recommended",
"rules": {
"not-rely-on-time": "warn",
"compiler-version": "off"
},
}
If not explicitly added, this rule will not be executed.
- RULE:
compiler-version
default was updated from ^0.5.2 to ^0.8.0
- Rule:
check-send-result
added config clarification in the newNotes
section #482 - Rule:
compiler-version
default was updated from ^0.5.2 to ^0.8.0 #483
- New Rule: Enforces the use of Custom Errors over Require and Revert statements #475
- New Rule: Enforces the test_ prefix on a file for Foundry users #476
- New Rule: Enforces the naming of function return values #478
Notes
option on docs to add more information of each rule. Seefoundry-test-functions
. #476
func-named-parameters
- false positives on builtin functions #472ordering
- treat initializer weight same as constructor #474check-send-result
- false positive on `erc777.send()`` function #477explicit-types
- default value is now taking into account when no value is specified in config #481compiler-version
- default value is now taking into account when no value is specified in config #483
- Ignores empty constructors when inheriting a base contract #418
- Bump json5 from 2.1.3 to 2.2.3 #376
- Bump json-schema and jsprim #370
- Bump semver from 6.3.0 to 7.5.2 #438
- Corrected "Category" of
quotes
rule, added default rules list on readme #443 - 'Deprecated' column on `rules.md`` #444
- Information about maxCharacters allowed on
reason-string
rule #446 - E2E tests for
max-warnings
#455 - Replaced blacklist and whitelist words #459
- Removed runtime dependencies on load-rules #462
- Allowed $ symbol as part of naming #465
- Disabled
no-empty-blocks
rule for receive() function #466
- New Rule: No unused imports #417
- New Rule: To treat immutable as constants #458
- New Rule: Explicit-types. To forbid/enforce full type or alias for variables declaration #467
- New Rule: Naming of Function parameters. Enforce arguments naming #468
- JSON formatter support #440
- Rules List with
list-rules
command #449 - E2E tests for formatters and new
Compact formatter
#457
maxWarnings
parameter waiting review #439–fix
option not working in avoid-throw rule #442- Formatter option fixed for
stdin
command #450
- Updated solidity parser to 0.16.0 #420
- Added github workflow to execute unit tests on each PR #412
- Added macOS and windows into E2E github workflow #422
- False positive on for-loop Yul #400
- Ordering-rule support for Top Level statements #393
- Fix no-global-import to accept named global imports #416
- Fix named-parameters-mapping to not enforce on nested mappings #421
- Solhint dependencies to support newer versions #380
- Linter fixed to get clearer source code #381
- E2E, added formatters into repo, updated CI #385
- Solhint dependencies to support newer versions #403
- New Rule: For banning "console.sol" and "import hardhat or foundry console.sol" #372
- New Rule: No global imports #390
- New Rule: Named parameters in v0.8.18 solidity version #403
- TypeError: cannot read property 'errorCount' of undefined #351
- Directories with .sol in the name path treated as files #352
- Doc generator and added a CI step to avoid crashing #389
- Rule for banning "console.sol" and "import hardhat or foundry console.sol #391
- Option –quiet works now with all files #392
- Transfers with .call excluded from warning as low level code #394
- Made func-visibility skip free functions #396
- False positive on no-unused-vars for payable arguments without name #399
- New
compiler-version
rule (see PR #112)
- Several fixes for the
mark-callable-contracts
rule (PRs #115, #117 and #119)
Stable release
- Fix linter errors
- Update config initializer #103
- Remove prettier from rule
- Package version
- Add not-rely-on-time to rules documentation #88
- Have --max-warnings better reflect its name #89
- Added disable-previous-line #91
- Snake case now allows for a (single) leading underscore #93
- Fixed some comment directive tests #92
- Upgrade grammar #79
- Support prettier-solidity #72
- Add "Projects that use solhint" to README.md file #64
- Add prettier and airbnb #59
- Add new feature --ignore-path option #58
- Add contribution formatter parameter validation #54
- Add --max-warnings [int] option #56
- Add --quiet option #55
- Unable to satisfy indentation rules for functions with multiple return values #49