Skip to content

Commit 61190f9

Browse files
Merge pull request #657 from protofire/feat/imports-checker
new rule: import-path-check
2 parents bc5b011 + 35408ae commit 61190f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1052
-645
lines changed

conf/rulesets/solhint-all.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = Object.freeze({
3737
'gas-struct-packing': 'warn',
3838
'comprehensive-interface': 'warn',
3939
'duplicated-imports': 'warn',
40+
'import-path-check': ['warn', ['[~dependenciesPath]']],
4041
quotes: ['error', 'double'],
4142
'const-name-snakecase': 'warn',
4243
'contract-name-capwords': 'warn',

conf/rulesets/solhint-recommended.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = Object.freeze({
2121
},
2222
],
2323
'gas-custom-errors': 'warn',
24+
'import-path-check': ['warn', ['[~dependenciesPath]']],
2425
quotes: ['error', 'double'],
2526
'const-name-snakecase': 'warn',
2627
'contract-name-capwords': 'warn',

docs/rules.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: "default"
44
title: "Rule Index of Solhint"
55
---
66

7-
## Best Practice Rules
7+
## Best Practices Rules
88

99
| Rule Id | Error | Recommended | Deprecated |
1010
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ---------- |
@@ -21,6 +21,7 @@ title: "Rule Index of Solhint"
2121
| [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) | $~~~~~~~~$✔️ | |
2222
| [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. | $~~~~~~~~$✔️ | |
2323
| [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. | $~~~~~~~~$✔️ | |
24+
| [constructor-syntax](./rules/best-practices/constructor-syntax.md) | Constructors should use the new constructor keyword. | | |
2425
2526

2627
## Style Guide Rules
@@ -48,13 +49,6 @@ title: "Rule Index of Solhint"
4849
| [visibility-modifier-order](./rules/order/visibility-modifier-order.md) | Visibility modifier must be first in list of modifiers. | $~~~~~~~~$✔️ | |
4950
5051

51-
## Best Practices Rules
52-
53-
| Rule Id | Error | Recommended | Deprecated |
54-
| ------------------------------------------------------------------ | ---------------------------------------------------- | ----------- | ---------- |
55-
| [constructor-syntax](./rules/best-practices/constructor-syntax.md) | Constructors should use the new constructor keyword. | | |
56-
57-
5852
## Gas Consumption Rules
5953

6054
| Rule Id | Error | Recommended | Deprecated |
@@ -76,6 +70,7 @@ title: "Rule Index of Solhint"
7670
| Rule Id | Error | Recommended | Deprecated |
7771
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------- |
7872
| [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. | | |
73+
| [import-path-check](./rules/miscellaneous/import-path-check.md) | Check if an import file exits in target path | $~~~~~~~~$✔️ | |
7974
| [quotes](./rules/miscellaneous/quotes.md) | Enforces the use of double or simple quotes as configured for string literals. Values must be 'single' or 'double'. | $~~~~~~~~$✔️ | |
8075
8176

docs/rules/best-practices/code-complexity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "code-complexity | Solhint"
55
---
66

77
# code-complexity
8-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
8+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
99
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
1010

1111
## Description

docs/rules/best-practices/explicit-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "explicit-types | Solhint"
66

77
# explicit-types
88
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
9-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
9+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
1010
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
1111
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.
1212

docs/rules/best-practices/function-max-lines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "function-max-lines | Solhint"
55
---
66

77
# function-max-lines
8-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
8+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
99
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
1010

1111
## Description

docs/rules/best-practices/max-line-length.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "max-line-length | Solhint"
55
---
66

77
# max-line-length
8-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
8+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
99
![Default Severity Badge error](https://img.shields.io/badge/Default%20Severity-error-red)
1010
> The {"extends": "solhint:default"} property in a configuration file enables this rule. THIS IS DEPRECATED SINCE VERSION 5.1.0
1111

docs/rules/best-practices/max-states-count.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "max-states-count | Solhint"
66

77
# max-states-count
88
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
9-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
9+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
1010
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
1111
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.
1212

docs/rules/best-practices/no-console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "no-console | Solhint"
66

77
# no-console
88
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
9-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
9+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
1010
![Default Severity Badge error](https://img.shields.io/badge/Default%20Severity-error-red)
1111
> The {"extends": "solhint:default"} property in a configuration file enables this rule. THIS IS DEPRECATED SINCE VERSION 5.1.0
1212

docs/rules/best-practices/no-empty-blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "no-empty-blocks | Solhint"
66

77
# no-empty-blocks
88
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
9-
![Category Badge](https://img.shields.io/badge/-Best%20Practice%20Rules-informational)
9+
![Category Badge](https://img.shields.io/badge/-Best%20Practices%20Rules-informational)
1010
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
1111
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.
1212

0 commit comments

Comments
 (0)