diff --git a/CHANGELOG.md b/CHANGELOG.md index f0304637..1434efe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ ## [5.0.1] - 2024-05-13 ### BREAKING CHANGES (refer to v5.0.0) -Fixed an issue on the returining values where only was evaluating the first report instead of all of them. +Fixed an issue on the returning values where only was evaluating the first report instead of all of them.

@@ -68,7 +68,7 @@ Thanks to [@juanpcapurro](https://github.com/juanpcapurro) for providing the cod - New Rule: Interface starts with `i` [#557](https://github.com/protofire/solhint/pull/557) #### Gas Consumption Rules -- New Rule: [GC] Mutlitoken1155 rule [#541](https://github.com/protofire/solhint/pull/541) +- New Rule: [GC] Multitoken1155 rule [#541](https://github.com/protofire/solhint/pull/541) - New Rule: [GC] Small strings check [#542](https://github.com/protofire/solhint/pull/542) - New Rule: [GC] Indexed events [#543](https://github.com/protofire/solhint/pull/543) - New Rule: [GC] Calldata parameters [#544](https://github.com/protofire/solhint/pull/544) @@ -153,7 +153,7 @@ Thanks to [@juanpcapurro](https://github.com/juanpcapurro) for providing the cod ### Fixed - `foundry-test-functions` - Modified regex to include invariant and statefulFuzz tests [#484](https://github.com/protofire/solhint/pull/484) -- `quotes` - To allow quotes inside double quotes and viceversa [#485](https://github.com/protofire/solhint/pull/485) +- `quotes` - To allow quotes inside double quotes and vice versa [#485](https://github.com/protofire/solhint/pull/485) - `JSON` - Formatter returning JS object instead of standard json [#490](https://github.com/protofire/solhint/pull/490) diff --git a/README.md b/README.md index 46378fbb..91cdf52e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +

By Protofire @@ -16,7 +16,7 @@ https://coveralls.io/github/protofire/solhint?branch=master) This is an open source project for linting [Solidity](http://solidity.readthedocs.io/en/develop/) code. This project provides both **Security** and **Style Guide** validations.
-[VISIT OUR WEBSITE](https://protofire.io/projects/solhint)
+[VISIT OUR WEBSITE](https://protofire.io/solhint)
[JOIN OUR DISCORD SERVER](https://discord.gg/4TYGq3zpjs)
## Installation diff --git a/docs/configuration.md b/docs/configuration.md index 39e9ed25..3046ec7b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -4,7 +4,7 @@ title: Solhint Configuration date: 2017-10-23 14:16:00 +0300 author: "@drabenia" description: Configuration of solidity security and style guide verification, - best practise validations. + best practice validations. --- ### Configuration diff --git a/docs/rules.md b/docs/rules.md index 8c644b5f..7c79c301 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -4,24 +4,23 @@ layout: "default" title: "Rule Index of Solhint" --- -## Best Practise Rules +## Best Practice Rules | Rule Id | Error | Recommended | Deprecated | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ---------- | -| [code-complexity](./rules/best-practises/code-complexity.md) | Function has cyclomatic complexity "current" but allowed no more than maxcompl. | | | -| [explicit-types](./rules/best-practises/explicit-types.md) | Forbid or enforce explicit types (like uint256) that have an alias (like uint). | $~~~~~~~~$✔️ | | -| [function-max-lines](./rules/best-practises/function-max-lines.md) | Function body contains "count" lines but allowed no more than maxlines. | | | -| [max-line-length](./rules/best-practises/max-line-length.md) | Line length must be no more than maxlen. | | | -| [max-states-count](./rules/best-practises/max-states-count.md) | Contract has "some count" states declarations but allowed no more than maxstates. | $~~~~~~~~$✔️ | | -| [no-console](./rules/best-practises/no-console.md) | No console.log/logInt/logBytesX/logString/etc & No hardhat and forge-std console.sol import statements. | $~~~~~~~~$✔️ | | -| [no-empty-blocks](./rules/best-practises/no-empty-blocks.md) | Code block has zero statements inside. Exceptions apply. | $~~~~~~~~$✔️ | | -| [no-global-import](./rules/best-practises/no-global-import.md) | Import statement includes an entire file instead of selected symbols. | $~~~~~~~~$✔️ | | -| [no-unused-import](./rules/best-practises/no-unused-import.md) | Imported object name is not being used by the contract. | $~~~~~~~~$✔️ | | -| [no-unused-vars](./rules/best-practises/no-unused-vars.md) | Variable "name" is unused. | $~~~~~~~~$✔️ | | -| [one-contract-per-file](./rules/best-practises/one-contract-per-file.md) | Enforces the use of ONE Contract per file see [here](https://docs.soliditylang.org/en/v0.8.21/style-guide.html#contract-and-library-names) | $~~~~~~~~$✔️ | | -| [payable-fallback](./rules/best-practises/payable-fallback.md) | When fallback is not payable and there is no receive function you will not be able to receive currency. | $~~~~~~~~$✔️ | | -| [reason-string](./rules/best-practises/reason-string.md) | Require or revert statement must have a reason string and check that each reason string is at most N characters long. | $~~~~~~~~$✔️ | | -| [constructor-syntax](./rules/best-practises/constructor-syntax.md) | Constructors should use the new constructor keyword. | | | +| [code-complexity](./rules/best-practices/code-complexity.md) | Function has cyclomatic complexity "current" but allowed no more than maxcompl. | | | +| [explicit-types](./rules/best-practices/explicit-types.md) | Forbid or enforce explicit types (like uint256) that have an alias (like uint). | $~~~~~~~~$✔️ | | +| [function-max-lines](./rules/best-practices/function-max-lines.md) | Function body contains "count" lines but allowed no more than maxlines. | | | +| [max-line-length](./rules/best-practices/max-line-length.md) | Line length must be no more than maxlen. | | | +| [max-states-count](./rules/best-practices/max-states-count.md) | Contract has "some count" states declarations but allowed no more than maxstates. | $~~~~~~~~$✔️ | | +| [no-console](./rules/best-practices/no-console.md) | No console.log/logInt/logBytesX/logString/etc & No hardhat and forge-std console.sol import statements. | $~~~~~~~~$✔️ | | +| [no-empty-blocks](./rules/best-practices/no-empty-blocks.md) | Code block has zero statements inside. Exceptions apply. | $~~~~~~~~$✔️ | | +| [no-global-import](./rules/best-practices/no-global-import.md) | Import statement includes an entire file instead of selected symbols. | $~~~~~~~~$✔️ | | +| [no-unused-import](./rules/best-practices/no-unused-import.md) | Imported object name is not being used by the contract. | $~~~~~~~~$✔️ | | +| [no-unused-vars](./rules/best-practices/no-unused-vars.md) | Variable "name" is unused. | $~~~~~~~~$✔️ | | +| [one-contract-per-file](./rules/best-practices/one-contract-per-file.md) | Enforces the use of ONE Contract per file see [here](https://docs.soliditylang.org/en/v0.8.21/style-guide.html#contract-and-library-names) | $~~~~~~~~$✔️ | | +| [payable-fallback](./rules/best-practices/payable-fallback.md) | When fallback is not payable and there is no receive function you will not be able to receive currency. | $~~~~~~~~$✔️ | | +| [reason-string](./rules/best-practices/reason-string.md) | Require or revert statement must have a reason string and check that each reason string is at most N characters long. | $~~~~~~~~$✔️ | | ## Style Guide Rules @@ -49,13 +48,20 @@ title: "Rule Index of Solhint" | [visibility-modifier-order](./rules/order/visibility-modifier-order.md) | Visibility modifier must be first in list of modifiers. | $~~~~~~~~$✔️ | | +## Best Practices Rules + +| Rule Id | Error | Recommended | Deprecated | +| ------------------------------------------------------------------ | ---------------------------------------------------- | ----------- | ---------- | +| [constructor-syntax](./rules/best-practices/constructor-syntax.md) | Constructors should use the new constructor keyword. | | | + + ## Gas Consumption Rules | Rule Id | Error | Recommended | Deprecated | | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------ | ---------- | | [gas-calldata-parameters](./rules/gas-consumption/gas-calldata-parameters.md) | Suggest calldata keyword on function arguments when read only | | | | [gas-custom-errors](./rules/gas-consumption/gas-custom-errors.md) | Enforces the use of Custom Errors over Require and Revert statements | $~~~~~~~~$✔️ | | -| [gas-increment-by-one](./rules/gas-consumption/gas-increment-by-one.md) | Suggest incrementation by one like this ++i instead of other type | | | +| [gas-increment-by-one](./rules/gas-consumption/gas-increment-by-one.md) | Suggest increments by one, like this ++i instead of other type | | | | [gas-indexed-events](./rules/gas-consumption/gas-indexed-events.md) | Suggest indexed arguments on events for uint, bool and address | | | | [gas-length-in-loops](./rules/gas-consumption/gas-length-in-loops.md) | Suggest replacing object.length in a loop condition to avoid calculation on each lap | | | | [gas-multitoken1155](./rules/gas-consumption/gas-multitoken1155.md) | ERC1155 is a cheaper non-fungible token than ERC721 | | | @@ -67,10 +73,10 @@ title: "Rule Index of Solhint" ## Miscellaneous -| Rule Id | Error | Recommended | Deprecated | -| --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------- | -| [comprehensive-interface](./rules/miscellaneous/comprehensive-interface.md) | Check that all public or external functions are override. This is iseful to make sure that the whole API is extracted in an interface. | | | -| [quotes](./rules/miscellaneous/quotes.md) | Enforces the use of double or simple quotes as configured for string literals. Values must be 'single' or 'double'. | $~~~~~~~~$✔️ | | +| Rule Id | Error | Recommended | Deprecated | +| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------- | +| [comprehensive-interface](./rules/miscellaneous/comprehensive-interface.md) | Check that all public or external functions are overridden. This is useful to make sure that the whole API is extracted in an interface. | | | +| [quotes](./rules/miscellaneous/quotes.md) | Enforces the use of double or simple quotes as configured for string literals. Values must be 'single' or 'double'. | $~~~~~~~~$✔️ | | ## Security Rules @@ -98,5 +104,5 @@ title: "Rule Index of Solhint" ## References -- [ConsenSys Guide for Smart Contracts](https://consensys.github.io/smart-contract-best-practices/recommendations/) +- [ConsenSys Guide for Smart Contracts](https://consensys.github.io/smart-contract-best-practices/development-recommendations/) - [Solidity Style Guide](http://solidity.readthedocs.io/en/develop/style-guide.html) diff --git a/docs/rules/best-practises/code-complexity.md b/docs/rules/best-practices/code-complexity.md similarity index 78% rename from docs/rules/best-practises/code-complexity.md rename to docs/rules/best-practices/code-complexity.md index d5642859..a24a049e 100644 --- a/docs/rules/best-practises/code-complexity.md +++ b/docs/rules/best-practices/code-complexity.md @@ -5,7 +5,7 @@ title: "code-complexity | Solhint" --- # code-complexity -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) ## Description @@ -67,9 +67,9 @@ while (d > e) { } ``` ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/code-complexity.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/code-complexity.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/code-complexity.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/code-complexity.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/code-complexity.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/code-complexity.js) diff --git a/docs/rules/best-practises/constructor-syntax.md b/docs/rules/best-practices/constructor-syntax.md similarity index 68% rename from docs/rules/best-practises/constructor-syntax.md rename to docs/rules/best-practices/constructor-syntax.md index e25d5c63..5b0543eb 100644 --- a/docs/rules/best-practises/constructor-syntax.md +++ b/docs/rules/best-practices/constructor-syntax.md @@ -5,14 +5,14 @@ title: "constructor-syntax | Solhint" --- # constructor-syntax -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) ## Description Constructors should use the new constructor keyword. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -28,9 +28,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.2.0](https://github.com/protofire/solhint/tree/v1.2.0) +This rule was introduced in [Solhint 1.2.0](https://github.com/protofire/solhint/blob/v1.2.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/deprecations/constructor-syntax.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/deprecations/constructor-syntax.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/deprecations/constructor-syntax.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/deprecations/constructor-syntax.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/deprecations/constructor-syntax.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/deprecations/constructor-syntax.js) diff --git a/docs/rules/best-practises/explicit-types.md b/docs/rules/best-practices/explicit-types.md similarity index 77% rename from docs/rules/best-practises/explicit-types.md rename to docs/rules/best-practices/explicit-types.md index 2a472762..abf0b10d 100644 --- a/docs/rules/best-practises/explicit-types.md +++ b/docs/rules/best-practices/explicit-types.md @@ -6,7 +6,7 @@ title: "explicit-types | Solhint" # explicit-types ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -77,9 +77,9 @@ uint public variableName = uint256(5) ``` ## Version -This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/tree/v3.5.1) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/explicit-types.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/explicit-types.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/explicit-types.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/explicit-types.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/explicit-types.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/explicit-types.js) diff --git a/docs/rules/best-practises/function-max-lines.md b/docs/rules/best-practices/function-max-lines.md similarity index 64% rename from docs/rules/best-practises/function-max-lines.md rename to docs/rules/best-practices/function-max-lines.md index 3bedcd83..209d1f9d 100644 --- a/docs/rules/best-practises/function-max-lines.md +++ b/docs/rules/best-practices/function-max-lines.md @@ -5,7 +5,7 @@ title: "function-max-lines | Solhint" --- # function-max-lines -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) ## Description @@ -34,9 +34,9 @@ This rule accepts an array of options: This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/function-max-lines.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/function-max-lines.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/function-max-lines.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/function-max-lines.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/function-max-lines.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/function-max-lines.js) diff --git a/docs/rules/best-practises/max-line-length.md b/docs/rules/best-practices/max-line-length.md similarity index 66% rename from docs/rules/best-practises/max-line-length.md rename to docs/rules/best-practices/max-line-length.md index 6017c3b4..d0c02777 100644 --- a/docs/rules/best-practises/max-line-length.md +++ b/docs/rules/best-practices/max-line-length.md @@ -5,7 +5,7 @@ title: "max-line-length | Solhint" --- # max-line-length -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge error](https://img.shields.io/badge/Default%20Severity-error-red) > The {"extends": "solhint:default"} property in a configuration file enables this rule. @@ -36,9 +36,9 @@ This rule accepts an array of options: This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/max-line-length.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/max-line-length.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/max-line-length.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/max-line-length.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/max-line-length.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/max-line-length.js) diff --git a/docs/rules/best-practises/max-states-count.md b/docs/rules/best-practices/max-states-count.md similarity index 83% rename from docs/rules/best-practises/max-states-count.md rename to docs/rules/best-practices/max-states-count.md index 3258d9cf..6306d5e8 100644 --- a/docs/rules/best-practises/max-states-count.md +++ b/docs/rules/best-practices/max-states-count.md @@ -6,7 +6,7 @@ title: "max-states-count | Solhint" # max-states-count ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -99,9 +99,9 @@ This rule accepts an array of options: ``` ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/max-states-count.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/max-states-count.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/max-states-count.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/max-states-count.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/max-states-count.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/max-states-count.js) diff --git a/docs/rules/best-practises/no-console.md b/docs/rules/best-practices/no-console.md similarity index 70% rename from docs/rules/best-practises/no-console.md rename to docs/rules/best-practices/no-console.md index 84f6549a..c6765893 100644 --- a/docs/rules/best-practises/no-console.md +++ b/docs/rules/best-practices/no-console.md @@ -6,7 +6,7 @@ title: "no-console | Solhint" # no-console ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge error](https://img.shields.io/badge/Default%20Severity-error-red) > The {"extends": "solhint:default"} property in a configuration file enables this rule. @@ -17,7 +17,7 @@ title: "no-console | Solhint" No console.log/logInt/logBytesX/logString/etc & No hardhat and forge-std console.sol import statements. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to error. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to error. ### Example Config ```json @@ -53,9 +53,9 @@ import "forge-std/consoleN.sol" ``` ## Version -This rule was introduced in [Solhint 3.4.0](https://github.com/protofire/solhint/tree/v3.4.0) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/no-console.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/no-console.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/no-console.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-console.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/no-console.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/no-console.js) diff --git a/docs/rules/best-practises/no-empty-blocks.md b/docs/rules/best-practices/no-empty-blocks.md similarity index 72% rename from docs/rules/best-practises/no-empty-blocks.md rename to docs/rules/best-practices/no-empty-blocks.md index d8a18752..bc54fe80 100644 --- a/docs/rules/best-practises/no-empty-blocks.md +++ b/docs/rules/best-practices/no-empty-blocks.md @@ -6,7 +6,7 @@ title: "no-empty-blocks | Solhint" # no-empty-blocks ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "no-empty-blocks | Solhint" Code block has zero statements inside. Exceptions apply. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -65,9 +65,9 @@ constructor () { } ``` ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/no-empty-blocks.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/no-empty-blocks.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/no-empty-blocks.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-empty-blocks.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/no-empty-blocks.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/no-empty-blocks.js) diff --git a/docs/rules/best-practises/no-global-import.md b/docs/rules/best-practices/no-global-import.md similarity index 69% rename from docs/rules/best-practises/no-global-import.md rename to docs/rules/best-practices/no-global-import.md index 1d95ccd4..2ebbd01c 100644 --- a/docs/rules/best-practises/no-global-import.md +++ b/docs/rules/best-practices/no-global-import.md @@ -6,7 +6,7 @@ title: "no-global-import | Solhint" # no-global-import ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "no-global-import | Solhint" Import statement includes an entire file instead of selected symbols. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -63,9 +63,9 @@ import "foo.sol" ``` ## Version -This rule was introduced in [Solhint 3.4.0](https://github.com/protofire/solhint/tree/v3.4.0) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/no-global-import.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/no-global-import.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/no-global-import.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-global-import.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/no-global-import.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/no-global-import.js) diff --git a/docs/rules/best-practises/no-unused-import.md b/docs/rules/best-practices/no-unused-import.md similarity index 68% rename from docs/rules/best-practises/no-unused-import.md rename to docs/rules/best-practices/no-unused-import.md index 8d567c91..ff253f1d 100644 --- a/docs/rules/best-practises/no-unused-import.md +++ b/docs/rules/best-practices/no-unused-import.md @@ -6,7 +6,7 @@ title: "no-unused-import | Solhint" # no-unused-import ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "no-unused-import | Solhint" Imported object name is not being used by the contract. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -51,9 +51,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war ``` ## Version -This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/tree/v3.5.1) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/no-unused-import.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/no-unused-import.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/no-unused-import.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-unused-import.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/no-unused-import.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/no-unused-import.js) diff --git a/docs/rules/best-practises/no-unused-vars.md b/docs/rules/best-practices/no-unused-vars.md similarity index 57% rename from docs/rules/best-practises/no-unused-vars.md rename to docs/rules/best-practices/no-unused-vars.md index 5ef1ba30..c34045cc 100644 --- a/docs/rules/best-practises/no-unused-vars.md +++ b/docs/rules/best-practices/no-unused-vars.md @@ -6,7 +6,7 @@ title: "no-unused-vars | Solhint" # no-unused-vars ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "no-unused-vars | Solhint" Variable "name" is unused. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/no-unused-vars.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/no-unused-vars.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/no-unused-vars.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-unused-vars.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/no-unused-vars.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/no-unused-vars.js) diff --git a/docs/rules/best-practises/one-contract-per-file.md b/docs/rules/best-practices/one-contract-per-file.md similarity index 60% rename from docs/rules/best-practises/one-contract-per-file.md rename to docs/rules/best-practices/one-contract-per-file.md index 92135351..2a59f567 100644 --- a/docs/rules/best-practises/one-contract-per-file.md +++ b/docs/rules/best-practices/one-contract-per-file.md @@ -6,7 +6,7 @@ title: "one-contract-per-file | Solhint" # one-contract-per-file ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "one-contract-per-file | Solhint" Enforces the use of ONE Contract per file see [here](https://docs.soliditylang.org/en/v0.8.21/style-guide.html#contract-and-library-names) ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 3.6.2](https://github.com/protofire/solhint/tree/v3.6.2) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/one-contract-per-file.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/one-contract-per-file.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/one-contract-per-file.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/one-contract-per-file.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/one-contract-per-file.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/one-contract-per-file.js) diff --git a/docs/rules/best-practises/payable-fallback.md b/docs/rules/best-practices/payable-fallback.md similarity index 72% rename from docs/rules/best-practises/payable-fallback.md rename to docs/rules/best-practices/payable-fallback.md index ca8d6b5c..3108b87c 100644 --- a/docs/rules/best-practises/payable-fallback.md +++ b/docs/rules/best-practices/payable-fallback.md @@ -6,7 +6,7 @@ title: "payable-fallback | Solhint" # payable-fallback ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -15,7 +15,7 @@ title: "payable-fallback | Solhint" When fallback is not payable and there is no receive function you will not be able to receive currency. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -60,9 +60,9 @@ fallback() {} function g() payable {} ``` ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/payable-fallback.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/payable-fallback.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/payable-fallback.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/payable-fallback.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/payable-fallback.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/payable-fallback.js) diff --git a/docs/rules/best-practises/reason-string.md b/docs/rules/best-practices/reason-string.md similarity index 81% rename from docs/rules/best-practises/reason-string.md rename to docs/rules/best-practices/reason-string.md index b919d85e..3b41906f 100644 --- a/docs/rules/best-practises/reason-string.md +++ b/docs/rules/best-practices/reason-string.md @@ -6,7 +6,7 @@ title: "reason-string | Solhint" # reason-string ![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) +![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational) ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) > The {"extends": "solhint:recommended"} property in a configuration file enables this rule. @@ -77,9 +77,9 @@ This rule accepts an array of options: ``` ## Version -This rule was introduced in [Solhint 2.3.1](https://github.com/protofire/solhint/tree/v2.3.1) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/reason-string.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/reason-string.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/reason-string.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/reason-string.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/reason-string.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/reason-string.js) diff --git a/docs/rules/best-practises/custom-errors.md b/docs/rules/best-practises/custom-errors.md deleted file mode 100644 index 18330416..00000000 --- a/docs/rules/best-practises/custom-errors.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -warning: "This is a dynamically generated file. Do not edit manually." -layout: "default" -title: "custom-errors | Solhint" ---- - -# custom-errors -![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen) -![Category Badge](https://img.shields.io/badge/-Best%20Practise%20Rules-informational) -![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) -> The {"extends": "solhint:recommended"} property in a configuration file enables this rule. - - -## Description -Enforces the use of Custom Errors over Require and Revert statements - -## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. - -### Example Config -```json -{ - "rules": { - "custom-errors": "warn" - } -} -``` - - -## Examples -### 👍 Examples of **correct** code for this rule - -#### Use of Custom Errors - -```solidity -revert CustomErrorFunction(); -``` - -#### Use of Custom Errors with arguments - -```solidity -revert CustomErrorFunction({ msg: "Insufficient Balance" }); -``` - -### 👎 Examples of **incorrect** code for this rule - -#### Use of require statement - -```solidity -require(userBalance >= availableAmount, "Insufficient Balance"); -``` - -#### Use of plain revert statement - -```solidity -revert(); -``` - -#### Use of revert statement with message - -```solidity -revert("Insufficient Balance"); -``` - -## Version -This rule was introduced in [Solhint 3.6.1](https://github.com/protofire/solhint/tree/v3.6.1) - -## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/custom-errors.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/custom-errors.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/custom-errors.js) diff --git a/docs/rules/gas-consumption/gas-calldata-parameters.md b/docs/rules/gas-consumption/gas-calldata-parameters.md index 30223d27..1b022d2e 100644 --- a/docs/rules/gas-consumption/gas-calldata-parameters.md +++ b/docs/rules/gas-consumption/gas-calldata-parameters.md @@ -12,7 +12,7 @@ title: "gas-calldata-parameters | Solhint" Suggest calldata keyword on function arguments when read only ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -33,9 +33,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-calldata-parameters.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-calldata-parameters.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-calldata-parameters.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-calldata-parameters.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-calldata-parameters.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-calldata-parameters.js) diff --git a/docs/rules/gas-consumption/gas-custom-errors.md b/docs/rules/gas-consumption/gas-custom-errors.md index 6f89f6da..c8e6c906 100644 --- a/docs/rules/gas-consumption/gas-custom-errors.md +++ b/docs/rules/gas-consumption/gas-custom-errors.md @@ -15,7 +15,7 @@ title: "gas-custom-errors | Solhint" Enforces the use of Custom Errors over Require and Revert statements ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -65,9 +65,9 @@ revert("Insufficient Balance"); ``` ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-custom-errors.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-custom-errors.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-custom-errors.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-custom-errors.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-custom-errors.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-custom-errors.js) diff --git a/docs/rules/gas-consumption/gas-increment-by-one.md b/docs/rules/gas-consumption/gas-increment-by-one.md index 97f11c1a..91394e91 100644 --- a/docs/rules/gas-consumption/gas-increment-by-one.md +++ b/docs/rules/gas-consumption/gas-increment-by-one.md @@ -9,10 +9,10 @@ title: "gas-increment-by-one | Solhint" ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) ## Description -Suggest incrementation by one like this ++i instead of other type +Suggest increments by one, like this ++i instead of other type ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -24,7 +24,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war ``` ### Notes -- This rule only works for expressions like this: [ j = j + 1 ] but will fail is the code is written like this: [ j = 1 + j ] +- This rule only works for expressions like this: [ j = j + 1 ] but will fail if the code is written like this: [ j = 1 + j ] - [source 1](https://coinsbench.com/comprehensive-guide-tips-and-tricks-for-gas-optimization-in-solidity-5380db734404) of the rule initiative (Incrementing/Decrementing By 1) - [source 2](https://www.rareskills.io/post/gas-optimization?postId=c9db474a-ff97-4fa3-a51d-fe13ccb8fe3b#viewer-8rekj) of the rule initiative @@ -32,9 +32,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-increment-by-one.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-increment-by-one.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-increment-by-one.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-increment-by-one.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-increment-by-one.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-increment-by-one.js) diff --git a/docs/rules/gas-consumption/gas-indexed-events.md b/docs/rules/gas-consumption/gas-indexed-events.md index 6dbf7e95..e0ff00c9 100644 --- a/docs/rules/gas-consumption/gas-indexed-events.md +++ b/docs/rules/gas-consumption/gas-indexed-events.md @@ -12,7 +12,7 @@ title: "gas-indexed-events | Solhint" Suggest indexed arguments on events for uint, bool and address ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -30,9 +30,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-indexed-events.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-indexed-events.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-indexed-events.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-indexed-events.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-indexed-events.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-indexed-events.js) diff --git a/docs/rules/gas-consumption/gas-length-in-loops.md b/docs/rules/gas-consumption/gas-length-in-loops.md index 6c58fa17..f9283fd1 100644 --- a/docs/rules/gas-consumption/gas-length-in-loops.md +++ b/docs/rules/gas-consumption/gas-length-in-loops.md @@ -12,7 +12,7 @@ title: "gas-length-in-loops | Solhint" Suggest replacing object.length in a loop condition to avoid calculation on each lap ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -30,9 +30,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-length-in-loops.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-length-in-loops.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-length-in-loops.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-length-in-loops.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-length-in-loops.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-length-in-loops.js) diff --git a/docs/rules/gas-consumption/gas-multitoken1155.md b/docs/rules/gas-consumption/gas-multitoken1155.md index 6e67f5e5..df2ecfe2 100644 --- a/docs/rules/gas-consumption/gas-multitoken1155.md +++ b/docs/rules/gas-consumption/gas-multitoken1155.md @@ -12,7 +12,7 @@ title: "gas-multitoken1155 | Solhint" ERC1155 is a cheaper non-fungible token than ERC721 ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -30,9 +30,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-multitoken1155.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-multitoken1155.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-multitoken1155.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-multitoken1155.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-multitoken1155.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-multitoken1155.js) diff --git a/docs/rules/gas-consumption/gas-named-return-values.md b/docs/rules/gas-consumption/gas-named-return-values.md index aea699d1..d0deeb5f 100644 --- a/docs/rules/gas-consumption/gas-named-return-values.md +++ b/docs/rules/gas-consumption/gas-named-return-values.md @@ -12,7 +12,7 @@ title: "gas-named-return-values | Solhint" Enforce the return values of a function to be named ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -42,9 +42,9 @@ function checkBalance(address wallet) external view returns(uint256) {} ``` ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-named-return-values.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-named-return-values.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-named-return-values.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-named-return-values.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-named-return-values.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-named-return-values.js) diff --git a/docs/rules/gas-consumption/gas-small-strings.md b/docs/rules/gas-consumption/gas-small-strings.md index b8d3d3b0..d2e976e8 100644 --- a/docs/rules/gas-consumption/gas-small-strings.md +++ b/docs/rules/gas-consumption/gas-small-strings.md @@ -12,7 +12,7 @@ title: "gas-small-strings | Solhint" Keep strings smaller than 32 bytes ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -30,9 +30,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-small-strings.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-small-strings.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-small-strings.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-small-strings.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-small-strings.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-small-strings.js) diff --git a/docs/rules/gas-consumption/gas-strict-inequalities.md b/docs/rules/gas-consumption/gas-strict-inequalities.md index 5c12a0fb..ece15f03 100644 --- a/docs/rules/gas-consumption/gas-strict-inequalities.md +++ b/docs/rules/gas-consumption/gas-strict-inequalities.md @@ -12,7 +12,7 @@ title: "gas-strict-inequalities | Solhint" Suggest Strict Inequalities over non Strict ones ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -32,9 +32,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-strict-inequalities.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-strict-inequalities.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-strict-inequalities.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-strict-inequalities.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-strict-inequalities.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-strict-inequalities.js) diff --git a/docs/rules/gas-consumption/gas-struct-packing.md b/docs/rules/gas-consumption/gas-struct-packing.md index 5c350e3a..313edfc1 100644 --- a/docs/rules/gas-consumption/gas-struct-packing.md +++ b/docs/rules/gas-consumption/gas-struct-packing.md @@ -12,7 +12,7 @@ title: "gas-struct-packing | Solhint" Suggest to re-arrange struct packing order when it is inefficient ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -32,9 +32,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/blob/v4.5.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-struct-packing.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-struct-packing.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-struct-packing.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/gas-consumption/gas-struct-packing.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/gas-consumption/gas-struct-packing.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/gas-consumption/gas-struct-packing.js) diff --git a/docs/rules/gas-consumption/named-return-values.md b/docs/rules/gas-consumption/named-return-values.md deleted file mode 100644 index 0c5ce0b8..00000000 --- a/docs/rules/gas-consumption/named-return-values.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -warning: "This is a dynamically generated file. Do not edit manually." -layout: "default" -title: "named-return-values | Solhint" ---- - -# named-return-values -![Category Badge](https://img.shields.io/badge/-Gas%20Consumption%20Rules-informational) -![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) - -## Description -Enforce the return values of a function to be named - -## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. - -### Example Config -```json -{ - "rules": { - "named-return-values": "warn" - } -} -``` - - -## Examples -### 👍 Examples of **correct** code for this rule - -#### Function definition with named return values - -```solidity -function checkBalance(address wallet) external view returns(uint256 retBalance) {} -``` - -### 👎 Examples of **incorrect** code for this rule - -#### Function definition with UNNAMED return values - -```solidity -function checkBalance(address wallet) external view returns(uint256) {} -``` - -## Version -This rule is introduced in the latest version. - -## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/gas-consumption/gas-named-return-values.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/gas-consumption/gas-named-return-values.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/gas-consumption/gas-named-return-values.js) diff --git a/docs/rules/miscellaneous/comprehensive-interface.md b/docs/rules/miscellaneous/comprehensive-interface.md index 6ec24fcd..6e5b6ec3 100644 --- a/docs/rules/miscellaneous/comprehensive-interface.md +++ b/docs/rules/miscellaneous/comprehensive-interface.md @@ -9,10 +9,10 @@ title: "comprehensive-interface | Solhint" ![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) ## Description -Check that all public or external functions are override. This is iseful to make sure that the whole API is extracted in an interface. +Check that all public or external functions are overridden. This is useful to make sure that the whole API is extracted in an interface. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -52,9 +52,9 @@ contract Foo { ``` ## Version -This rule was introduced in [Solhint 3.3.0](https://github.com/protofire/solhint/tree/v3.3.0) +This rule was introduced in [Solhint 3.3.0](https://github.com/protofire/solhint/blob/v3.3.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/miscellaneous/comprehensive-interface.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/miscellaneous/comprehensive-interface.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/miscellaneous/comprehensive-interface.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/miscellaneous/comprehensive-interface.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/miscellaneous/comprehensive-interface.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/miscellaneous/comprehensive-interface.js) diff --git a/docs/rules/miscellaneous/quotes.md b/docs/rules/miscellaneous/quotes.md index d2a0134b..54e9e07b 100644 --- a/docs/rules/miscellaneous/quotes.md +++ b/docs/rules/miscellaneous/quotes.md @@ -105,9 +105,9 @@ string private constant STR = 'You shall "pass" !'; ``` ## Version -This rule was introduced in [Solhint 1.4.0](https://github.com/protofire/solhint/tree/v1.4.0) +This rule was introduced in [Solhint 1.4.0](https://github.com/protofire/solhint/blob/v1.4.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/miscellaneous/quotes.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/miscellaneous/quotes.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/miscellaneous/quotes.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/miscellaneous/quotes.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/miscellaneous/quotes.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/miscellaneous/quotes.js) diff --git a/docs/rules/naming/const-name-snakecase.md b/docs/rules/naming/const-name-snakecase.md index fc5cb3ac..ae148cb8 100644 --- a/docs/rules/naming/const-name-snakecase.md +++ b/docs/rules/naming/const-name-snakecase.md @@ -15,7 +15,7 @@ title: "const-name-snakecase | Solhint" Constant name must be in capitalized SNAKE_CASE. (Does not check IMMUTABLES, use immutable-vars-naming) ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/const-name-snakecase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/const-name-snakecase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/const-name-snakecase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/const-name-snakecase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/const-name-snakecase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/const-name-snakecase.js) diff --git a/docs/rules/naming/contract-name-camelcase.md b/docs/rules/naming/contract-name-camelcase.md index 03fca320..eba5d37d 100644 --- a/docs/rules/naming/contract-name-camelcase.md +++ b/docs/rules/naming/contract-name-camelcase.md @@ -15,7 +15,7 @@ title: "contract-name-camelcase | Solhint" Contract, Structs and Enums should be in CamelCase. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -34,9 +34,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/contract-name-camelcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/contract-name-camelcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/contract-name-camelcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/contract-name-camelcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/contract-name-camelcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/contract-name-camelcase.js) diff --git a/docs/rules/naming/event-name-camelcase.md b/docs/rules/naming/event-name-camelcase.md index a6c00b63..91f18d97 100644 --- a/docs/rules/naming/event-name-camelcase.md +++ b/docs/rules/naming/event-name-camelcase.md @@ -15,7 +15,7 @@ title: "event-name-camelcase | Solhint" Event name must be in CamelCase. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -34,9 +34,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/event-name-camelcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/event-name-camelcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/event-name-camelcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/event-name-camelcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/event-name-camelcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/event-name-camelcase.js) diff --git a/docs/rules/naming/foundry-test-functions.md b/docs/rules/naming/foundry-test-functions.md index ff14f06e..6e09f5b4 100644 --- a/docs/rules/naming/foundry-test-functions.md +++ b/docs/rules/naming/foundry-test-functions.md @@ -65,9 +65,9 @@ function numberIs42() public {} ``` ## Version -This rule was introduced in [Solhint 3.6.1](https://github.com/protofire/solhint/tree/v3.6.1) +This rule was introduced in [Solhint 3.6.1](https://github.com/protofire/solhint/blob/v3.6.1) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/foundry-test-functions.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/foundry-test-functions.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/foundry-test-functions.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/foundry-test-functions.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/foundry-test-functions.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/foundry-test-functions.js) diff --git a/docs/rules/naming/func-name-mixedcase.md b/docs/rules/naming/func-name-mixedcase.md index c51e2160..fbd296a3 100644 --- a/docs/rules/naming/func-name-mixedcase.md +++ b/docs/rules/naming/func-name-mixedcase.md @@ -15,7 +15,7 @@ title: "func-name-mixedcase | Solhint" Function name must be in mixedCase. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/func-name-mixedcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/func-name-mixedcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/func-name-mixedcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/func-name-mixedcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/func-name-mixedcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/func-name-mixedcase.js) diff --git a/docs/rules/naming/func-named-parameters.md b/docs/rules/naming/func-named-parameters.md index 88b660f9..b5b0a10c 100644 --- a/docs/rules/naming/func-named-parameters.md +++ b/docs/rules/naming/func-named-parameters.md @@ -66,9 +66,9 @@ functionName(_senderAddress, 1e18, _tokenAddress, _receiverAddress ) ``` ## Version -This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/tree/v3.5.1) +This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/blob/v3.5.1) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/func-named-parameters.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/func-named-parameters.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/func-named-parameters.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/func-named-parameters.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/func-named-parameters.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/func-named-parameters.js) diff --git a/docs/rules/naming/func-param-name-mixedcase.md b/docs/rules/naming/func-param-name-mixedcase.md index 3ad19653..1778dc6e 100644 --- a/docs/rules/naming/func-param-name-mixedcase.md +++ b/docs/rules/naming/func-param-name-mixedcase.md @@ -12,7 +12,7 @@ title: "func-param-name-mixedcase | Solhint" Function param name must be in mixedCase. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -28,9 +28,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/func-param-name-mixedcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/func-param-name-mixedcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/func-param-name-mixedcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/func-param-name-mixedcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/func-param-name-mixedcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/func-param-name-mixedcase.js) diff --git a/docs/rules/naming/immutable-vars-naming.md b/docs/rules/naming/immutable-vars-naming.md index a12c2291..d7d301be 100644 --- a/docs/rules/naming/immutable-vars-naming.md +++ b/docs/rules/naming/immutable-vars-naming.md @@ -37,9 +37,9 @@ This rule accepts an array of options: This rule does not have examples. ## Version -This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/tree/v3.5.1) +This rule was introduced in [Solhint 3.5.1](https://github.com/protofire/solhint/blob/v3.5.1) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/immutable-vars-naming.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/immutable-vars-naming.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/immutable-vars-naming.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/immutable-vars-naming.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/immutable-vars-naming.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/immutable-vars-naming.js) diff --git a/docs/rules/naming/imports-order.md b/docs/rules/naming/imports-order.md index 484934b6..7c668483 100644 --- a/docs/rules/naming/imports-order.md +++ b/docs/rules/naming/imports-order.md @@ -12,7 +12,7 @@ title: "imports-order | Solhint" Order the imports of the contract to follow a certain hierarchy (read "Notes section") ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -35,9 +35,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 5.0.2](https://github.com/protofire/solhint/tree/v5.0.2) +This rule was introduced in [Solhint 5.0.2](https://github.com/protofire/solhint/blob/v5.0.2) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/imports-order.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/imports-order.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/imports-order.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/imports-order.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/imports-order.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/imports-order.js) diff --git a/docs/rules/naming/interface-starts-with-i.md b/docs/rules/naming/interface-starts-with-i.md index b8962f9e..41d163c7 100644 --- a/docs/rules/naming/interface-starts-with-i.md +++ b/docs/rules/naming/interface-starts-with-i.md @@ -12,7 +12,7 @@ title: "interface-starts-with-i | Solhint" Solidity Interfaces names should start with an `I` ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -42,9 +42,9 @@ interface Foo { function foo () external; } ``` ## Version -This rule was introduced in [Solhint 4.5.0](https://github.com/protofire/solhint/tree/v4.5.0) +This rule is introduced in the latest version. ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/best-practises/interface-starts-with-i.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/best-practises/interface-starts-with-i.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/best-practises/interface-starts-with-i.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/interface-starts-with-i.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/best-practices/interface-starts-with-i.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/best-practices/interface-starts-with-i.js) diff --git a/docs/rules/naming/modifier-name-mixedcase.md b/docs/rules/naming/modifier-name-mixedcase.md index 23b695ef..aaf23a80 100644 --- a/docs/rules/naming/modifier-name-mixedcase.md +++ b/docs/rules/naming/modifier-name-mixedcase.md @@ -12,7 +12,7 @@ title: "modifier-name-mixedcase | Solhint" Modifier name must be in mixedCase. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -28,9 +28,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/modifier-name-mixedcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/modifier-name-mixedcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/modifier-name-mixedcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/modifier-name-mixedcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/modifier-name-mixedcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/modifier-name-mixedcase.js) diff --git a/docs/rules/naming/named-parameters-mapping.md b/docs/rules/naming/named-parameters-mapping.md index fe793ea6..36f16c7e 100644 --- a/docs/rules/naming/named-parameters-mapping.md +++ b/docs/rules/naming/named-parameters-mapping.md @@ -12,7 +12,7 @@ title: "named-parameters-mapping | Solhint" Solidity v0.8.18 introduced named parameters on the mappings definition. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -39,7 +39,7 @@ mapping(string name => uint256 balance) public users; mapping(address owner => mapping(address token => uint256 balance)) public tokenBalances; ``` -#### Main key of mapping is enforced. On nested mappings other naming are not necessary +#### Main key of mapping is enforced. On nested mappings other names are not necessary ```solidity mapping(address owner => mapping(address => uint256)) public tokenBalances; @@ -77,16 +77,16 @@ mapping(address token => uint256)) public tokenBalances; mapping(address => uint256 balance)) public tokenBalances; ``` -#### No MAIN KEY naming in nested mapping. Other naming are not enforced +#### No MAIN KEY naming in nested mapping. Other names are not enforced ```solidity mapping(address => mapping(address token => uint256 balance)) public tokenBalances; ``` ## Version -This rule was introduced in [Solhint 3.4.0](https://github.com/protofire/solhint/tree/v3.4.0) +This rule was introduced in [Solhint 3.4.0](https://github.com/protofire/solhint/blob/v3.4.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/named-parameters-mapping.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/named-parameters-mapping.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/named-parameters-mapping.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/named-parameters-mapping.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/named-parameters-mapping.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/named-parameters-mapping.js) diff --git a/docs/rules/naming/named-return-values.md b/docs/rules/naming/named-return-values.md deleted file mode 100644 index 660fba64..00000000 --- a/docs/rules/naming/named-return-values.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -warning: "This is a dynamically generated file. Do not edit manually." -layout: "default" -title: "named-return-values | Solhint" ---- - -# named-return-values -![Category Badge](https://img.shields.io/badge/-Style%20Guide%20Rules-informational) -![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow) - -## Description -Enforce the return values of a function to be named - -## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. - -### Example Config -```json -{ - "rules": { - "named-return-values": "warn" - } -} -``` - - -## Examples -### 👍 Examples of **correct** code for this rule - -#### Function definition with named return values - -```solidity -function checkBalance(address wallet) external view returns(uint256 retBalance) {} -``` - -### 👎 Examples of **incorrect** code for this rule - -#### Function definition with UNNAMED return values - -```solidity -function checkBalance(address wallet) external view returns(uint256) {} -``` - -## Version -This rule was introduced in [Solhint 3.6.1](https://github.com/protofire/solhint/tree/v3.6.1) - -## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/named-return-values.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/named-return-values.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/named-return-values.js) diff --git a/docs/rules/naming/private-vars-leading-underscore.md b/docs/rules/naming/private-vars-leading-underscore.md index a638d310..909c43cc 100644 --- a/docs/rules/naming/private-vars-leading-underscore.md +++ b/docs/rules/naming/private-vars-leading-underscore.md @@ -90,9 +90,9 @@ uint256 thisIsInternalVariable; ``` ## Version -This rule was introduced in [Solhint 3.0.0-rc.3](https://github.com/protofire/solhint/tree/v3.0.0-rc.3) +This rule was introduced in [Solhint 3.0.0-rc.3](https://github.com/protofire/solhint/blob/v3.0.0-rc.3) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/private-vars-leading-underscore.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/private-vars-leading-underscore.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/private-vars-leading-underscore.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/private-vars-leading-underscore.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/private-vars-leading-underscore.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/private-vars-leading-underscore.js) diff --git a/docs/rules/naming/use-forbidden-name.md b/docs/rules/naming/use-forbidden-name.md index 3776b896..442ea8b9 100644 --- a/docs/rules/naming/use-forbidden-name.md +++ b/docs/rules/naming/use-forbidden-name.md @@ -15,7 +15,7 @@ title: "use-forbidden-name | Solhint" Avoid to use letters 'I', 'l', 'O' as identifiers. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/use-forbidden-name.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/use-forbidden-name.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/use-forbidden-name.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/use-forbidden-name.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/use-forbidden-name.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/use-forbidden-name.js) diff --git a/docs/rules/naming/var-name-mixedcase.md b/docs/rules/naming/var-name-mixedcase.md index 913a62cd..fe391e35 100644 --- a/docs/rules/naming/var-name-mixedcase.md +++ b/docs/rules/naming/var-name-mixedcase.md @@ -15,7 +15,7 @@ title: "var-name-mixedcase | Solhint" Variable name must be in mixedCase. (Does not check IMMUTABLES, use immutable-vars-naming) ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/var-name-mixedcase.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/naming/var-name-mixedcase.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/naming/var-name-mixedcase.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/var-name-mixedcase.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/var-name-mixedcase.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/var-name-mixedcase.js) diff --git a/docs/rules/order/func-order.md b/docs/rules/order/func-order.md index b1b391f5..3eb65f15 100644 --- a/docs/rules/order/func-order.md +++ b/docs/rules/order/func-order.md @@ -15,7 +15,7 @@ title: "func-order | Solhint" Function order is incorrect. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -65,9 +65,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war ``` ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/order/func-order.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/order/func-order.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/order/func-order.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/order/func-order.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/order/func-order.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/order/func-order.js) diff --git a/docs/rules/order/imports-on-top.md b/docs/rules/order/imports-on-top.md index 0ac69679..5408c7b4 100644 --- a/docs/rules/order/imports-on-top.md +++ b/docs/rules/order/imports-on-top.md @@ -15,7 +15,7 @@ title: "imports-on-top | Solhint" Import statements must be on top. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/blob/v1.1.5) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/order/imports-on-top.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/order/imports-on-top.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/order/imports-on-top.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/order/imports-on-top.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/order/imports-on-top.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/order/imports-on-top.js) diff --git a/docs/rules/order/ordering.md b/docs/rules/order/ordering.md index 5e0d0092..8779efeb 100644 --- a/docs/rules/order/ordering.md +++ b/docs/rules/order/ordering.md @@ -12,7 +12,7 @@ title: "ordering | Solhint" Check order of elements in file and inside each contract, according to the style guide. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -340,9 +340,9 @@ contract MyContract { ``` ## Version -This rule was introduced in [Solhint 3.2.0](https://github.com/protofire/solhint/tree/v3.2.0) +This rule was introduced in [Solhint 3.2.0](https://github.com/protofire/solhint/blob/v3.2.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/order/ordering.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/order/ordering.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/order/ordering.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/order/ordering.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/order/ordering.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/order/ordering.js) diff --git a/docs/rules/order/visibility-modifier-order.md b/docs/rules/order/visibility-modifier-order.md index 1f4d755f..9f1a2744 100644 --- a/docs/rules/order/visibility-modifier-order.md +++ b/docs/rules/order/visibility-modifier-order.md @@ -15,7 +15,7 @@ title: "visibility-modifier-order | Solhint" Visibility modifier must be first in list of modifiers. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -59,9 +59,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war ``` ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/blob/v1.1.5) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/order/visibility-modifier-order.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/order/visibility-modifier-order.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/order/visibility-modifier-order.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/order/visibility-modifier-order.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/order/visibility-modifier-order.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/order/visibility-modifier-order.js) diff --git a/docs/rules/security/avoid-call-value.md b/docs/rules/security/avoid-call-value.md index 2a032333..07e6ced0 100644 --- a/docs/rules/security/avoid-call-value.md +++ b/docs/rules/security/avoid-call-value.md @@ -15,7 +15,7 @@ title: "avoid-call-value | Solhint" Avoid to use ".call.value()()". ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-call-value.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-call-value.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-call-value.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-call-value.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-call-value.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-call-value.js) diff --git a/docs/rules/security/avoid-low-level-calls.md b/docs/rules/security/avoid-low-level-calls.md index eea9d153..11833ac9 100644 --- a/docs/rules/security/avoid-low-level-calls.md +++ b/docs/rules/security/avoid-low-level-calls.md @@ -15,7 +15,7 @@ title: "avoid-low-level-calls | Solhint" Avoid to use low level calls. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -48,9 +48,9 @@ anyAddress.call.value(code)(); ``` ## Version -This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/tree/v1.1.6) +This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/blob/v1.1.6) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-low-level-calls.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-low-level-calls.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-low-level-calls.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-low-level-calls.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-low-level-calls.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-low-level-calls.js) diff --git a/docs/rules/security/avoid-sha3.md b/docs/rules/security/avoid-sha3.md index 7947a087..5e9b7016 100644 --- a/docs/rules/security/avoid-sha3.md +++ b/docs/rules/security/avoid-sha3.md @@ -15,7 +15,7 @@ title: "avoid-sha3 | Solhint" Use "keccak256" instead of deprecated "sha3". ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -33,9 +33,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-sha3.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-sha3.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-sha3.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-sha3.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-sha3.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-sha3.js) diff --git a/docs/rules/security/avoid-suicide.md b/docs/rules/security/avoid-suicide.md index 95fa418c..a5a57e83 100644 --- a/docs/rules/security/avoid-suicide.md +++ b/docs/rules/security/avoid-suicide.md @@ -15,7 +15,7 @@ title: "avoid-suicide | Solhint" Use "selfdestruct" instead of deprecated "suicide". ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-suicide.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-suicide.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-suicide.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-suicide.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-suicide.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-suicide.js) diff --git a/docs/rules/security/avoid-throw.md b/docs/rules/security/avoid-throw.md index 5b12fcd7..d83b6bf5 100644 --- a/docs/rules/security/avoid-throw.md +++ b/docs/rules/security/avoid-throw.md @@ -15,7 +15,7 @@ title: "avoid-throw | Solhint" "throw" is deprecated, avoid to use it. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -33,9 +33,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-throw.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-throw.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-throw.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-throw.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-throw.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-throw.js) diff --git a/docs/rules/security/avoid-tx-origin.md b/docs/rules/security/avoid-tx-origin.md index 9e238acc..e4d21d01 100644 --- a/docs/rules/security/avoid-tx-origin.md +++ b/docs/rules/security/avoid-tx-origin.md @@ -15,7 +15,7 @@ title: "avoid-tx-origin | Solhint" Avoid to use tx.origin. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/blob/v1.1.5) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/avoid-tx-origin.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/avoid-tx-origin.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/avoid-tx-origin.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/avoid-tx-origin.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/avoid-tx-origin.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/avoid-tx-origin.js) diff --git a/docs/rules/security/check-send-result.md b/docs/rules/security/check-send-result.md index 18db9a94..efbac6d9 100644 --- a/docs/rules/security/check-send-result.md +++ b/docs/rules/security/check-send-result.md @@ -15,7 +15,7 @@ title: "check-send-result | Solhint" Check result of "send" call. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -54,9 +54,9 @@ x.send(55); ``` ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/check-send-result.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/check-send-result.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/check-send-result.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/check-send-result.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/check-send-result.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/check-send-result.js) diff --git a/docs/rules/security/compiler-version.md b/docs/rules/security/compiler-version.md index d7bc39de..5bb37df6 100644 --- a/docs/rules/security/compiler-version.md +++ b/docs/rules/security/compiler-version.md @@ -37,9 +37,9 @@ This rule accepts an array of options: This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.1.0](https://github.com/protofire/solhint/tree/v2.1.0) +This rule was introduced in [Solhint 2.1.0](https://github.com/protofire/solhint/blob/v2.1.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/compiler-version.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/compiler-version.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/compiler-version.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/compiler-version.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/compiler-version.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/compiler-version.js) diff --git a/docs/rules/security/func-visibility.md b/docs/rules/security/func-visibility.md index 97e13645..c85eda84 100644 --- a/docs/rules/security/func-visibility.md +++ b/docs/rules/security/func-visibility.md @@ -55,9 +55,9 @@ function b() { } ``` ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/func-visibility.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/func-visibility.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/func-visibility.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/func-visibility.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/func-visibility.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/func-visibility.js) diff --git a/docs/rules/security/mark-callable-contracts.md b/docs/rules/security/mark-callable-contracts.md index 31a12045..56858d97 100644 --- a/docs/rules/security/mark-callable-contracts.md +++ b/docs/rules/security/mark-callable-contracts.md @@ -15,7 +15,7 @@ title: "mark-callable-contracts | Solhint" Explicitly mark all external contracts as trusted or untrusted. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -45,9 +45,9 @@ Bank.withdraw(100); ``` ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/mark-callable-contracts.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/mark-callable-contracts.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/mark-callable-contracts.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/mark-callable-contracts.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/mark-callable-contracts.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/mark-callable-contracts.js) diff --git a/docs/rules/security/multiple-sends.md b/docs/rules/security/multiple-sends.md index 122c013d..41b3cb93 100644 --- a/docs/rules/security/multiple-sends.md +++ b/docs/rules/security/multiple-sends.md @@ -15,7 +15,7 @@ title: "multiple-sends | Solhint" Avoid multiple calls of "send" method in single transaction. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/multiple-sends.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/multiple-sends.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/multiple-sends.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/multiple-sends.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/multiple-sends.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/multiple-sends.js) diff --git a/docs/rules/security/no-complex-fallback.md b/docs/rules/security/no-complex-fallback.md index bdd158a9..b2d4410e 100644 --- a/docs/rules/security/no-complex-fallback.md +++ b/docs/rules/security/no-complex-fallback.md @@ -15,7 +15,7 @@ title: "no-complex-fallback | Solhint" Fallback function must be simple. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/no-complex-fallback.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/no-complex-fallback.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/no-complex-fallback.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/no-complex-fallback.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/no-complex-fallback.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/no-complex-fallback.js) diff --git a/docs/rules/security/no-inline-assembly.md b/docs/rules/security/no-inline-assembly.md index 73702de2..b4efa739 100644 --- a/docs/rules/security/no-inline-assembly.md +++ b/docs/rules/security/no-inline-assembly.md @@ -15,7 +15,7 @@ title: "no-inline-assembly | Solhint" Avoid to use inline assembly. It is acceptable only in rare cases. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/tree/v1.1.6) +This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/blob/v1.1.6) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/no-inline-assembly.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/no-inline-assembly.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/no-inline-assembly.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/no-inline-assembly.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/no-inline-assembly.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/no-inline-assembly.js) diff --git a/docs/rules/security/not-rely-on-block-hash.md b/docs/rules/security/not-rely-on-block-hash.md index 234c91d3..35dd82fd 100644 --- a/docs/rules/security/not-rely-on-block-hash.md +++ b/docs/rules/security/not-rely-on-block-hash.md @@ -15,7 +15,7 @@ title: "not-rely-on-block-hash | Solhint" Do not rely on "block.blockhash". Miners can influence its value. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/tree/v1.1.6) +This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/blob/v1.1.6) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/not-rely-on-block-hash.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/not-rely-on-block-hash.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/not-rely-on-block-hash.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/not-rely-on-block-hash.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/not-rely-on-block-hash.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/not-rely-on-block-hash.js) diff --git a/docs/rules/security/not-rely-on-time.md b/docs/rules/security/not-rely-on-time.md index dcc24251..9071e7ed 100644 --- a/docs/rules/security/not-rely-on-time.md +++ b/docs/rules/security/not-rely-on-time.md @@ -12,7 +12,7 @@ title: "not-rely-on-time | Solhint" Avoid making time-based decisions in your business logic. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -28,9 +28,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/tree/v1.1.5) +This rule was introduced in [Solhint 1.1.5](https://github.com/protofire/solhint/blob/v1.1.5) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/not-rely-on-time.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/not-rely-on-time.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/not-rely-on-time.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/not-rely-on-time.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/not-rely-on-time.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/not-rely-on-time.js) diff --git a/docs/rules/security/reentrancy.md b/docs/rules/security/reentrancy.md index 569338ba..6cf1388f 100644 --- a/docs/rules/security/reentrancy.md +++ b/docs/rules/security/reentrancy.md @@ -15,7 +15,7 @@ title: "reentrancy | Solhint" Possible reentrancy vulnerabilities. Avoid state changes after transfer. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -139,9 +139,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war ``` ## Version -This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/tree/v1.1.6) +This rule was introduced in [Solhint 1.1.6](https://github.com/protofire/solhint/blob/v1.1.6) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/reentrancy.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/reentrancy.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/reentrancy.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/reentrancy.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/reentrancy.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/reentrancy.js) diff --git a/docs/rules/security/state-visibility.md b/docs/rules/security/state-visibility.md index fa81b049..89b4d34a 100644 --- a/docs/rules/security/state-visibility.md +++ b/docs/rules/security/state-visibility.md @@ -15,7 +15,7 @@ title: "state-visibility | Solhint" Explicitly mark visibility of state. ## Options -This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn. +This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn. ### Example Config ```json @@ -31,9 +31,9 @@ This rule accepts a string option of rule severity. Must be one of "error", "war This rule does not have examples. ## Version -This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/tree/v2.0.0-alpha.0) +This rule was introduced in [Solhint 2.0.0-alpha.0](https://github.com/protofire/solhint/blob/v2.0.0-alpha.0) ## Resources -- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/security/state-visibility.js) -- [Document source](https://github.com/protofire/solhint/tree/master/docs/rules/security/state-visibility.md) -- [Test cases](https://github.com/protofire/solhint/tree/master/test/rules/security/state-visibility.js) +- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/security/state-visibility.js) +- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/security/state-visibility.md) +- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/security/state-visibility.js) diff --git a/lib/rules/best-practises/code-complexity.js b/lib/rules/best-practices/code-complexity.js similarity index 93% rename from lib/rules/best-practises/code-complexity.js rename to lib/rules/best-practices/code-complexity.js index a581462c..5c5731c9 100644 --- a/lib/rules/best-practises/code-complexity.js +++ b/lib/rules/best-practices/code-complexity.js @@ -5,11 +5,11 @@ const ruleId = 'code-complexity' const DEFAULT_SEVERITY = 'warn' const DEFAULT_COMPLEXITY = 7 const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Function has cyclomatic complexity "current" but allowed no more than maxcompl.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, @@ -24,13 +24,13 @@ const meta = { good: [ { description: 'Low code complexity', - code: require('../../../test/fixtures/best-practises/code-complexity-low'), + code: require('../../../test/fixtures/best-practices/code-complexity-low'), }, ], bad: [ { description: 'High code complexity', - code: require('../../../test/fixtures/best-practises/code-complexity-high'), + code: require('../../../test/fixtures/best-practices/code-complexity-high'), }, ], }, diff --git a/lib/rules/best-practises/explicit-types.js b/lib/rules/best-practices/explicit-types.js similarity index 98% rename from lib/rules/best-practises/explicit-types.js rename to lib/rules/best-practices/explicit-types.js index 217132c2..c3137d0e 100644 --- a/lib/rules/best-practises/explicit-types.js +++ b/lib/rules/best-practices/explicit-types.js @@ -12,11 +12,11 @@ let typesToSearch const ruleId = 'explicit-types' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Forbid or enforce explicit types (like uint256) that have an alias (like uint).', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, diff --git a/lib/rules/best-practises/function-max-lines.js b/lib/rules/best-practices/function-max-lines.js similarity index 96% rename from lib/rules/best-practises/function-max-lines.js rename to lib/rules/best-practices/function-max-lines.js index e0fdaddc..1b4e7def 100644 --- a/lib/rules/best-practises/function-max-lines.js +++ b/lib/rules/best-practices/function-max-lines.js @@ -5,11 +5,11 @@ const DEFAULT_SEVERITY = 'warn' const DEFAULT_MAX_LINES_COUNT = 50 const ruleId = 'function-max-lines' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Function body contains "count" lines but allowed no more than maxlines.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, diff --git a/lib/rules/best-practises/index.js b/lib/rules/best-practices/index.js similarity index 100% rename from lib/rules/best-practises/index.js rename to lib/rules/best-practices/index.js diff --git a/lib/rules/best-practises/interface-starts-with-i.js b/lib/rules/best-practices/interface-starts-with-i.js similarity index 100% rename from lib/rules/best-practises/interface-starts-with-i.js rename to lib/rules/best-practices/interface-starts-with-i.js diff --git a/lib/rules/best-practises/max-line-length.js b/lib/rules/best-practices/max-line-length.js similarity index 95% rename from lib/rules/best-practises/max-line-length.js rename to lib/rules/best-practices/max-line-length.js index 749bd4fb..21a99ce1 100644 --- a/lib/rules/best-practises/max-line-length.js +++ b/lib/rules/best-practices/max-line-length.js @@ -7,11 +7,11 @@ const ruleId = 'max-line-length' const DEFAULT_SEVERITY = 'error' const DEFAULT_MAX_LINE_LENGTH = 120 const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Line length must be no more than maxlen.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, diff --git a/lib/rules/best-practises/max-states-count.js b/lib/rules/best-practices/max-states-count.js similarity index 91% rename from lib/rules/best-practises/max-states-count.js rename to lib/rules/best-practices/max-states-count.js index b2ff5cb9..b5104515 100644 --- a/lib/rules/best-practises/max-states-count.js +++ b/lib/rules/best-practices/max-states-count.js @@ -6,12 +6,12 @@ const ruleId = 'max-states-count' const DEFAULT_SEVERITY = 'warn' const DEFAULT_MAX_STATES_COUNT = 15 const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Contract has "some count" states declarations but allowed no more than maxstates.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, @@ -26,13 +26,13 @@ const meta = { good: [ { description: 'Low number of states', - code: require('../../../test/fixtures/best-practises/number-of-states-low'), + code: require('../../../test/fixtures/best-practices/number-of-states-low'), }, ], bad: [ { description: 'High number of states', - code: require('../../../test/fixtures/best-practises/number-of-states-high'), + code: require('../../../test/fixtures/best-practices/number-of-states-high'), }, ], }, diff --git a/lib/rules/best-practises/no-console.js b/lib/rules/best-practices/no-console.js similarity index 97% rename from lib/rules/best-practises/no-console.js rename to lib/rules/best-practices/no-console.js index 1a8a0fa9..01d505ec 100644 --- a/lib/rules/best-practises/no-console.js +++ b/lib/rules/best-practices/no-console.js @@ -2,11 +2,11 @@ const BaseChecker = require('../base-checker') const ruleId = 'no-console' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'No console.log/logInt/logBytesX/logString/etc & No hardhat and forge-std console.sol import statements.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', examples: { bad: [ { diff --git a/lib/rules/best-practises/no-empty-blocks.js b/lib/rules/best-practices/no-empty-blocks.js similarity index 97% rename from lib/rules/best-practises/no-empty-blocks.js rename to lib/rules/best-practices/no-empty-blocks.js index a8c81bf7..4816bc57 100644 --- a/lib/rules/best-practises/no-empty-blocks.js +++ b/lib/rules/best-practices/no-empty-blocks.js @@ -3,11 +3,11 @@ const { isFallbackFunction, isReceiveFunction } = require('../../common/ast-type const ruleId = 'no-empty-blocks' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Code block has zero statements inside. Exceptions apply.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', examples: { bad: [ { description: 'Empty block on if statement', code: 'if (condition) { }' }, diff --git a/lib/rules/best-practises/no-global-import.js b/lib/rules/best-practices/no-global-import.js similarity index 95% rename from lib/rules/best-practises/no-global-import.js rename to lib/rules/best-practices/no-global-import.js index a4e337ac..6b0f71cb 100644 --- a/lib/rules/best-practises/no-global-import.js +++ b/lib/rules/best-practices/no-global-import.js @@ -2,11 +2,11 @@ const BaseChecker = require('../base-checker') const ruleId = 'no-global-import' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Import statement includes an entire file instead of selected symbols.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', examples: { bad: [ { description: 'import all members from a file', code: 'import * from "foo.sol"' }, diff --git a/lib/rules/best-practises/no-unused-import.js b/lib/rules/best-practices/no-unused-import.js similarity index 97% rename from lib/rules/best-practises/no-unused-import.js rename to lib/rules/best-practices/no-unused-import.js index 297875ff..5b4c7702 100644 --- a/lib/rules/best-practises/no-unused-import.js +++ b/lib/rules/best-practices/no-unused-import.js @@ -3,11 +3,11 @@ const BaseChecker = require('../base-checker') const ruleId = 'no-unused-import' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Imported object name is not being used by the contract.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', examples: { good: [ { diff --git a/lib/rules/best-practises/no-unused-vars.js b/lib/rules/best-practices/no-unused-vars.js similarity index 98% rename from lib/rules/best-practises/no-unused-vars.js rename to lib/rules/best-practices/no-unused-vars.js index 76cee5c5..939ec37f 100644 --- a/lib/rules/best-practises/no-unused-vars.js +++ b/lib/rules/best-practices/no-unused-vars.js @@ -6,11 +6,11 @@ const traversing = new TreeTraversing() const ruleId = 'no-unused-vars' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Variable "name" is unused.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', }, isDefault: false, diff --git a/lib/rules/best-practises/one-contract-per-file.js b/lib/rules/best-practices/one-contract-per-file.js similarity index 94% rename from lib/rules/best-practises/one-contract-per-file.js rename to lib/rules/best-practices/one-contract-per-file.js index 51cdf004..cadd1cd5 100644 --- a/lib/rules/best-practises/one-contract-per-file.js +++ b/lib/rules/best-practices/one-contract-per-file.js @@ -5,12 +5,12 @@ const DEFAULT_SEVERITY = 'warn' const ruleId = 'one-contract-per-file' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Enforces the use of ONE Contract per file see [here](https://docs.soliditylang.org/en/v0.8.21/style-guide.html#contract-and-library-names)', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, diff --git a/lib/rules/best-practises/payable-fallback.js b/lib/rules/best-practices/payable-fallback.js similarity index 97% rename from lib/rules/best-practises/payable-fallback.js rename to lib/rules/best-practices/payable-fallback.js index 6655bace..bc0b87a0 100644 --- a/lib/rules/best-practises/payable-fallback.js +++ b/lib/rules/best-practices/payable-fallback.js @@ -2,12 +2,12 @@ const BaseChecker = require('../base-checker') const ruleId = 'payable-fallback' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'When fallback is not payable and there is no receive function you will not be able to receive currency.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', examples: { good: [ { diff --git a/lib/rules/best-practises/reason-string.js b/lib/rules/best-practices/reason-string.js similarity index 94% rename from lib/rules/best-practises/reason-string.js rename to lib/rules/best-practices/reason-string.js index 33b44a2f..aff4b1fa 100644 --- a/lib/rules/best-practises/reason-string.js +++ b/lib/rules/best-practices/reason-string.js @@ -8,12 +8,12 @@ const DEFAULT_OPTION = { maxLength: DEFAULT_MAX_CHARACTERS_LONG } const ruleId = 'reason-string' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Require or revert statement must have a reason string and check that each reason string is at most N characters long.', - category: 'Best Practise Rules', + category: 'Best Practice Rules', options: [ { description: severityDescription, @@ -29,13 +29,13 @@ const meta = { good: [ { description: 'Require with reason string', - code: require('../../../test/fixtures/best-practises/require-with-reason'), + code: require('../../../test/fixtures/best-practices/require-with-reason'), }, ], bad: [ { description: 'Require without reason string', - code: require('../../../test/fixtures/best-practises/require-without-reason'), + code: require('../../../test/fixtures/best-practices/require-without-reason'), }, ], }, diff --git a/lib/rules/deprecations/constructor-syntax.js b/lib/rules/deprecations/constructor-syntax.js index 9129ebf8..cb569a84 100644 --- a/lib/rules/deprecations/constructor-syntax.js +++ b/lib/rules/deprecations/constructor-syntax.js @@ -2,11 +2,11 @@ const BaseDeprecation = require('./base-deprecation') const ruleId = 'constructor-syntax' const meta = { - type: 'best-practises', + type: 'best-practices', docs: { description: 'Constructors should use the new constructor keyword.', - category: 'Best Practise Rules', + category: 'Best Practices Rules', }, isDefault: false, diff --git a/lib/rules/gas-consumption/gas-increment-by-one.js b/lib/rules/gas-consumption/gas-increment-by-one.js index 74fc8a51..02fdbc55 100644 --- a/lib/rules/gas-consumption/gas-increment-by-one.js +++ b/lib/rules/gas-consumption/gas-increment-by-one.js @@ -6,11 +6,11 @@ const meta = { type: 'gas-consumption', docs: { - description: 'Suggest incrementation by one like this ++i instead of other type', + description: 'Suggest increments by one, like this ++i instead of other type', category: 'Gas Consumption Rules', notes: [ { - note: 'This rule only works for expressions like this: [ j = j + 1 ] but will fail is the code is written like this: [ j = 1 + j ]', + note: 'This rule only works for expressions like this: [ j = j + 1 ] but will fail if the code is written like this: [ j = 1 + j ]', }, { note: '[source 1](https://coinsbench.com/comprehensive-guide-tips-and-tricks-for-gas-optimization-in-solidity-5380db734404) of the rule initiative (Incrementing/Decrementing By 1)', diff --git a/lib/rules/index.js b/lib/rules/index.js index c423db5f..b9f4e245 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -3,7 +3,7 @@ const _ = require('lodash') const security = require('./security/index') const naming = require('./naming/index') const order = require('./order/index') -const bestPractises = require('./best-practises/index') +const bestPractices = require('./best-practices/index') const deprecations = require('./deprecations/index') const miscellaneous = require('./miscellaneous/index') const gasConsumption = require('./gas-consumption/index') @@ -59,7 +59,7 @@ function coreRules(meta) { const { reporter, config, inputSrc, tokens } = meta return [ - ...bestPractises(reporter, config, inputSrc, tokens), + ...bestPractices(reporter, config, inputSrc, tokens), ...deprecations(reporter), ...miscellaneous(reporter, config, tokens), ...naming(reporter, config), diff --git a/lib/rules/miscellaneous/comprehensive-interface.js b/lib/rules/miscellaneous/comprehensive-interface.js index 1ff4e0de..d61733dd 100644 --- a/lib/rules/miscellaneous/comprehensive-interface.js +++ b/lib/rules/miscellaneous/comprehensive-interface.js @@ -6,7 +6,7 @@ const meta = { docs: { description: - 'Check that all public or external functions are override. This is iseful to make sure that the whole API is extracted in an interface.', + 'Check that all public or external functions are overridden. This is useful to make sure that the whole API is extracted in an interface.', category: 'Miscellaneous', examples: { good: [ diff --git a/lib/rules/naming/named-parameters-mapping.js b/lib/rules/naming/named-parameters-mapping.js index a798abc8..63faac39 100644 --- a/lib/rules/naming/named-parameters-mapping.js +++ b/lib/rules/naming/named-parameters-mapping.js @@ -20,7 +20,7 @@ const meta = { }, { description: - 'Main key of mapping is enforced. On nested mappings other naming are not necessary', + 'Main key of mapping is enforced. On nested mappings other names are not necessary', code: 'mapping(address owner => mapping(address => uint256)) public tokenBalances;', }, { @@ -48,7 +48,7 @@ const meta = { code: 'mapping(address => uint256 balance)) public tokenBalances;', }, { - description: 'No MAIN KEY naming in nested mapping. Other naming are not enforced', + description: 'No MAIN KEY naming in nested mapping. Other names are not enforced', code: 'mapping(address => mapping(address token => uint256 balance)) public tokenBalances;', }, ], diff --git a/scripts/generate-rule-docs.js b/scripts/generate-rule-docs.js index 8b2c9953..5a1733bf 100755 --- a/scripts/generate-rule-docs.js +++ b/scripts/generate-rule-docs.js @@ -151,7 +151,7 @@ function loadOptions(rule) { ${table(optionsTable)} ` } else if (typeof rule.meta.defaultSetup === 'string') { - return `This rule accepts a string option of rule severity. Must be one of ${ruleSeverityEnum}. Default to ${rule.meta.defaultSetup}.` + return `This rule accepts a string option of rule severity. Must be one of ${ruleSeverityEnum}. Defaults to ${rule.meta.defaultSetup}.` } else { throw new Error(`Unhandled type of rule.meta.defaultSetup from rule ${rule.ruleId}`) } @@ -184,7 +184,7 @@ function loadNotes(rule) { function linkToVersion(version) { if (version) { - return `This rule was introduced in [Solhint ${version}](https://github.com/protofire/solhint/tree/v${version})` + return `This rule was introduced in [Solhint ${version}](https://github.com/protofire/solhint/blob/v${version})` } else { return `This rule is introduced in the latest version.` } @@ -192,19 +192,19 @@ function linkToVersion(version) { function linkToSource(rule) { const link = localPathToUri(rule.file) - return `https://github.com/protofire/solhint/tree/master${link}` + return `https://github.com/protofire/solhint/blob/master${link}` } function linkToDocumentSource(rule) { const link = localPathToUri(rule.file) .replace('lib/rules', 'docs/rules') .replace(/\.js$/, '.md') - return `https://github.com/protofire/solhint/tree/master${link}` + return `https://github.com/protofire/solhint/blob/master${link}` } function linkToTestCase(rule) { const link = localPathToUri(rule.file).replace('lib/rules/', '') - return `https://github.com/protofire/solhint/tree/master/test/rules${link}` + return `https://github.com/protofire/solhint/blob/master/test/rules${link}` } function localPathToUri(file) { @@ -283,7 +283,7 @@ ${contents} ## References -- [ConsenSys Guide for Smart Contracts](https://consensys.github.io/smart-contract-best-practices/recommendations/) +- [ConsenSys Guide for Smart Contracts](https://consensys.github.io/smart-contract-best-practices/development-recommendations/) - [Solidity Style Guide](http://solidity.readthedocs.io/en/develop/style-guide.html) ` } diff --git a/test/fixtures/best-practises/--fallback-not-payable.js b/test/fixtures/best-practices/--fallback-not-payable.js similarity index 100% rename from test/fixtures/best-practises/--fallback-not-payable.js rename to test/fixtures/best-practices/--fallback-not-payable.js diff --git a/test/fixtures/best-practises/--fallback-payable.js b/test/fixtures/best-practices/--fallback-payable.js similarity index 100% rename from test/fixtures/best-practises/--fallback-payable.js rename to test/fixtures/best-practices/--fallback-payable.js diff --git a/test/fixtures/best-practises/code-complexity-high.js b/test/fixtures/best-practices/code-complexity-high.js similarity index 100% rename from test/fixtures/best-practises/code-complexity-high.js rename to test/fixtures/best-practices/code-complexity-high.js diff --git a/test/fixtures/best-practises/code-complexity-low.js b/test/fixtures/best-practices/code-complexity-low.js similarity index 100% rename from test/fixtures/best-practises/code-complexity-low.js rename to test/fixtures/best-practices/code-complexity-low.js diff --git a/test/fixtures/best-practises/explicit-types.js b/test/fixtures/best-practices/explicit-types.js similarity index 100% rename from test/fixtures/best-practises/explicit-types.js rename to test/fixtures/best-practices/explicit-types.js diff --git a/test/fixtures/best-practises/number-of-states-high.js b/test/fixtures/best-practices/number-of-states-high.js similarity index 100% rename from test/fixtures/best-practises/number-of-states-high.js rename to test/fixtures/best-practices/number-of-states-high.js diff --git a/test/fixtures/best-practises/number-of-states-low.js b/test/fixtures/best-practices/number-of-states-low.js similarity index 100% rename from test/fixtures/best-practises/number-of-states-low.js rename to test/fixtures/best-practices/number-of-states-low.js diff --git a/test/fixtures/best-practises/one-contract-per-file.js b/test/fixtures/best-practices/one-contract-per-file.js similarity index 100% rename from test/fixtures/best-practises/one-contract-per-file.js rename to test/fixtures/best-practices/one-contract-per-file.js diff --git a/test/fixtures/best-practises/require-with-reason.js b/test/fixtures/best-practices/require-with-reason.js similarity index 100% rename from test/fixtures/best-practises/require-with-reason.js rename to test/fixtures/best-practices/require-with-reason.js diff --git a/test/fixtures/best-practises/require-without-reason.js b/test/fixtures/best-practices/require-without-reason.js similarity index 100% rename from test/fixtures/best-practises/require-without-reason.js rename to test/fixtures/best-practices/require-without-reason.js diff --git a/test/rules/best-practises/code-complexity.js b/test/rules/best-practices/code-complexity.js similarity index 91% rename from test/rules/best-practises/code-complexity.js rename to test/rules/best-practices/code-complexity.js index 5385e554..c0abe289 100644 --- a/test/rules/best-practises/code-complexity.js +++ b/test/rules/best-practices/code-complexity.js @@ -5,7 +5,7 @@ const { assertErrorCount, assertErrorMessage, assertNoErrors } = require('../../ describe('Linter - code-complexity', () => { it('should raise error when cyclomatic complexity of a function is too high', () => { const report = linter.processStr( - funcWith(require('../../fixtures/best-practises/code-complexity-high')), + funcWith(require('../../fixtures/best-practices/code-complexity-high')), { rules: { 'code-complexity': 'error' }, } @@ -17,7 +17,7 @@ describe('Linter - code-complexity', () => { it('should not raise error when cyclomatic complexity of a function is equal to max default allowed', () => { const report = linter.processStr( - funcWith(require('../../fixtures/best-practises/code-complexity-low')), + funcWith(require('../../fixtures/best-practices/code-complexity-low')), { rules: { 'code-complexity': 'error' }, } @@ -28,7 +28,7 @@ describe('Linter - code-complexity', () => { it('should raise error when cyclomatic complexity of a modifier is too high', () => { const report = linter.processStr( - modifierWith(require('../../fixtures/best-practises/code-complexity-high')), + modifierWith(require('../../fixtures/best-practices/code-complexity-high')), { rules: { 'code-complexity': 'error' }, } diff --git a/test/rules/best-practises/explicit-types.js b/test/rules/best-practices/explicit-types.js similarity index 97% rename from test/rules/best-practises/explicit-types.js rename to test/rules/best-practices/explicit-types.js index bdfebd3a..71abdb21 100644 --- a/test/rules/best-practises/explicit-types.js +++ b/test/rules/best-practices/explicit-types.js @@ -1,7 +1,7 @@ const linter = require('../../../lib/index') const contractWith = require('../../common/contract-builder').contractWith const { assertErrorCount, assertNoErrors, assertErrorMessage } = require('../../common/asserts') -const VAR_DECLARATIONS = require('../../fixtures/best-practises/explicit-types') +const VAR_DECLARATIONS = require('../../fixtures/best-practices/explicit-types') const getZeroErrosObject = () => { const zeroErrorsExplicit = {} diff --git a/test/rules/best-practises/function-max-lines.js b/test/rules/best-practices/function-max-lines.js similarity index 100% rename from test/rules/best-practises/function-max-lines.js rename to test/rules/best-practices/function-max-lines.js diff --git a/test/rules/best-practises/interface-starts-with-i.js b/test/rules/best-practices/interface-starts-with-i.js similarity index 100% rename from test/rules/best-practises/interface-starts-with-i.js rename to test/rules/best-practices/interface-starts-with-i.js diff --git a/test/rules/best-practises/max-line-length.js b/test/rules/best-practices/max-line-length.js similarity index 100% rename from test/rules/best-practises/max-line-length.js rename to test/rules/best-practices/max-line-length.js diff --git a/test/rules/best-practises/max-states-count.js b/test/rules/best-practices/max-states-count.js similarity index 92% rename from test/rules/best-practises/max-states-count.js rename to test/rules/best-practices/max-states-count.js index 4a5d354d..8956b71b 100644 --- a/test/rules/best-practises/max-states-count.js +++ b/test/rules/best-practices/max-states-count.js @@ -4,7 +4,7 @@ const { contractWith, stateDef } = require('../../common/contract-builder') describe('Linter - max-states-count', () => { it('should raise error when count of states too big', () => { - const code = require('../../fixtures/best-practises/number-of-states-high') + const code = require('../../fixtures/best-practices/number-of-states-high') const report = linter.processStr(code, { rules: { 'max-states-count': ['error', 15] }, @@ -15,7 +15,7 @@ describe('Linter - max-states-count', () => { }) it('should not raise error for count of states that lower that max', () => { - const code = require('../../fixtures/best-practises/number-of-states-low') + const code = require('../../fixtures/best-practices/number-of-states-low') const report = linter.processStr(code, { rules: { 'max-states-count': 'error' }, diff --git a/test/rules/best-practises/no-console.js b/test/rules/best-practices/no-console.js similarity index 100% rename from test/rules/best-practises/no-console.js rename to test/rules/best-practices/no-console.js diff --git a/test/rules/best-practises/no-empty-blocks.js b/test/rules/best-practices/no-empty-blocks.js similarity index 100% rename from test/rules/best-practises/no-empty-blocks.js rename to test/rules/best-practices/no-empty-blocks.js diff --git a/test/rules/best-practises/no-global-import.js b/test/rules/best-practices/no-global-import.js similarity index 100% rename from test/rules/best-practises/no-global-import.js rename to test/rules/best-practices/no-global-import.js diff --git a/test/rules/best-practises/no-unused-import.js b/test/rules/best-practices/no-unused-import.js similarity index 100% rename from test/rules/best-practises/no-unused-import.js rename to test/rules/best-practices/no-unused-import.js diff --git a/test/rules/best-practises/no-unused-vars.js b/test/rules/best-practices/no-unused-vars.js similarity index 100% rename from test/rules/best-practises/no-unused-vars.js rename to test/rules/best-practices/no-unused-vars.js diff --git a/test/rules/best-practises/one-contract-per-file.js b/test/rules/best-practices/one-contract-per-file.js similarity index 97% rename from test/rules/best-practises/one-contract-per-file.js rename to test/rules/best-practices/one-contract-per-file.js index 86dc782f..0483a39d 100644 --- a/test/rules/best-practises/one-contract-per-file.js +++ b/test/rules/best-practices/one-contract-per-file.js @@ -1,6 +1,6 @@ const { assertNoWarnings, assertErrorMessage, assertErrorCount } = require('../../common/asserts') const linter = require('../../../lib/index') -const contracts = require('../../fixtures/best-practises/one-contract-per-file') +const contracts = require('../../fixtures/best-practices/one-contract-per-file') describe('Linter - one-contract-per-file', () => { it('should not raise error for ONE contract only', () => { diff --git a/test/rules/best-practises/payable-fallback.js b/test/rules/best-practices/payable-fallback.js similarity index 100% rename from test/rules/best-practises/payable-fallback.js rename to test/rules/best-practices/payable-fallback.js diff --git a/test/rules/best-practises/reason-string.js b/test/rules/best-practices/reason-string.js similarity index 96% rename from test/rules/best-practises/reason-string.js rename to test/rules/best-practices/reason-string.js index 30546d7b..9b8aafc3 100644 --- a/test/rules/best-practises/reason-string.js +++ b/test/rules/best-practices/reason-string.js @@ -11,7 +11,7 @@ const { funcWith } = require('../../common/contract-builder') describe('Linter - reason-string', () => { it('should raise reason string is mandatory for require', () => { - const code = require('../../fixtures/best-practises/require-without-reason') + const code = require('../../fixtures/best-practices/require-without-reason') const report = linter.processStr(code, { rules: { 'reason-string': ['warn', { maxLength: 5 }] }, @@ -65,7 +65,7 @@ describe('Linter - reason-string', () => { }) it('should not raise warning for require', () => { - const code = require('../../fixtures/best-practises/require-with-reason') + const code = require('../../fixtures/best-practices/require-with-reason') const report = linter.processStr(code, { rules: { 'reason-string': ['warn', { maxLength: 31 }] },