Skip to content

Commit

Permalink
fix: minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Jan 15, 2025
1 parent 43d5045 commit 7fd122b
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion conf/rulesets/solhint-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ module.exports = Object.freeze({
immutablesAsConstants: true,
},
],
'imports-order': 'warn',
'modifier-name-mixedcase': 'warn',
'named-parameters-mapping': 'warn',
'private-vars-leading-underscore': [
Expand All @@ -62,6 +61,7 @@ module.exports = Object.freeze({
'use-forbidden-name': 'warn',
'var-name-mixedcase': 'warn',
'imports-on-top': 'warn',
'imports-order': 'warn',
ordering: 'warn',
'visibility-modifier-order': 'warn',
'avoid-call-value': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ title: "Rule Index of Solhint"
| [func-named-parameters](./rules/naming/func-named-parameters.md) | Enforce named parameters for function calls with 4 or more arguments. This rule may have some false positives | | |
| [func-param-name-mixedcase](./rules/naming/func-param-name-mixedcase.md) | Function param name must be in mixedCase. | | |
| [immutable-vars-naming](./rules/naming/immutable-vars-naming.md) | Check Immutable variables. Capitalized SNAKE_CASE or mixedCase depending on configuration. | $~~~~~~~~$✔️ | |
| [imports-order](./rules/naming/imports-order.md) | Order the imports of the contract to follow a certain hierarchy (read "Notes section") | | |
| [modifier-name-mixedcase](./rules/naming/modifier-name-mixedcase.md) | Modifier name must be in mixedCase. | | |
| [named-parameters-mapping](./rules/naming/named-parameters-mapping.md) | Solidity v0.8.18 introduced named parameters on the mappings definition. | | |
| [private-vars-leading-underscore](./rules/naming/private-vars-leading-underscore.md) | Non-external functions and state variables should start with a single underscore. Others, shouldn't | | |
| [use-forbidden-name](./rules/naming/use-forbidden-name.md) | Avoid to use letters 'I', 'l', 'O' as identifiers. | $~~~~~~~~$✔️ | |
| [var-name-mixedcase](./rules/naming/var-name-mixedcase.md) | Variable names must be in mixedCase. (Does not check IMMUTABLES, use immutable-vars-naming) | $~~~~~~~~$✔️ | |
| [func-order](./rules/order/func-order.md) | Function order is incorrect. | | $~~~~~~~$✔️ |
| [imports-on-top](./rules/order/imports-on-top.md) | Import statements must be on top. | $~~~~~~~~$✔️ | |
| [imports-order](./rules/naming/imports-order.md) | Order the imports of the contract to follow a certain hierarchy (read "Notes section") | | |
| [ordering](./rules/order/ordering.md) | Check order of elements in file and inside each contract, according to the style guide. | | |
| [visibility-modifier-order](./rules/order/visibility-modifier-order.md) | Visibility modifier must be first in list of modifiers. | $~~~~~~~~$✔️ | |
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/code-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ while (d > e) { }
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/code-complexity.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/explicit-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ uint public variableName = uint256(5)
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/explicit-types.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/function-max-lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This rule accepts an array of options:
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/function-max-lines.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/max-line-length.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This rule accepts an array of options:
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/max-line-length.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/max-states-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This rule accepts an array of options:
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/max-states-count.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/no-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import "forge-std/consoleN.sol"
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-console.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/no-empty-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ constructor () { }
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-empty-blocks.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/no-global-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import "foo.sol"
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-global-import.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/no-unused-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-unused-import.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/no-unused-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/no-unused-vars.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/one-contract-per-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/one-contract-per-file.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/payable-fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fallback() {} function g() payable {}
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/payable-fallback.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/best-practices/reason-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ This rule accepts an array of options:
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/reason-string.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/naming/contract-name-capwords.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/contract-name-capwords.js)
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/naming/event-name-capwords.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/event-name-capwords.js)
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/naming/imports-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/blob/v5.0.2)
This rule is introduced in the latest version.

## Resources
- [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)
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/order/imports-order.js)
- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/order/imports-order.md)
- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/order/imports-order.js)
2 changes: 1 addition & 1 deletion docs/rules/naming/interface-starts-with-i.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface Foo { function foo () external; }
```

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.4](https://github.com/protofire/solhint/blob/v5.0.4)

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/best-practices/interface-starts-with-i.js)
Expand Down
2 changes: 1 addition & 1 deletion e2e/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('e2e', function () {
const { code, stderr } = shell.exec(`${NODE}solhint Foo.sol -c ./noconfig/.solhint.json`)

expect(code).to.equal(EXIT_CODES.BAD_OPTIONS)
expect(stderr).to.include('couldnt be found')
expect(stderr).to.include("couldn't be found")
})

it('should create an initial config with --init', function () {
Expand Down
2 changes: 0 additions & 2 deletions lib/rules/naming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const NamedParametersMappingChecker = require('./named-parameters-mapping')
const ImmutableVarsNamingChecker = require('./immutable-vars-naming')
const FunctionNamedParametersChecker = require('./func-named-parameters')
const FoundryTestFunctionsChecker = require('./foundry-test-functions')
const ImportsOrderChecker = require('./imports-order')

module.exports = function checkers(reporter, config) {
return [
Expand All @@ -28,6 +27,5 @@ module.exports = function checkers(reporter, config) {
new ImmutableVarsNamingChecker(reporter, config),
new FunctionNamedParametersChecker(reporter, config),
new FoundryTestFunctionsChecker(reporter, config),
new ImportsOrderChecker(reporter, config),
]
}
File renamed without changes.
2 changes: 2 additions & 0 deletions lib/rules/order/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ const FuncOrderChecker = require('./func-order')
const ImportsOnTopChecker = require('./imports-on-top')
const VisibilityModifierOrderChecker = require('./visibility-modifier-order')
const OrderingChecker = require('./ordering')
const ImportsOrderChecker = require('./imports-order')

module.exports = function order(reporter, tokens) {
return [
new FuncOrderChecker(reporter),
new ImportsOnTopChecker(reporter),
new VisibilityModifierOrderChecker(reporter, tokens),
new OrderingChecker(reporter),
new ImportsOrderChecker(reporter),
]
}

0 comments on commit 7fd122b

Please sign in to comment.