Skip to content

Commit

Permalink
Merge pull request #389 from juanpcapurro/fix-doc-generation
Browse files Browse the repository at this point in the history
Fix doc generation
  • Loading branch information
dbale-altoros committed Jan 27, 2023
2 parents afc1d76 + 8b9ee5f commit a2b8ea3
Show file tree
Hide file tree
Showing 9 changed files with 351 additions and 67 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/E2E.yml
Expand Up @@ -20,10 +20,14 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: install
run: npm install --include=dev
- name: lint
run: npm run lint
- name: generate-docs
run: npm run docs
- name: pack
run: npm pack
- name: lint
run: npm install && npm run lint
- name: install-globally
run: npm i -g solhint*tgz
- name: run-e2e-tests
Expand Down
7 changes: 4 additions & 3 deletions docs/rules.md
Expand Up @@ -4,14 +4,15 @@ layout: "default"
title: "Rule Index of Solhint"
---

## Best Practice Rules
## Best Practise Rules

| Rule Id | Error | Recommended |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ----------- |
| [code-complexity](./rules/best-practises/code-complexity.md) | Function has cyclomatic complexity "current" but allowed no more than maxcompl. | |
| [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 contains empty block. | ✔️ |
| [no-unused-vars](./rules/best-practises/no-unused-vars.md) | Variable "name" is unused. | ✔️ |
| [payable-fallback](./rules/best-practises/payable-fallback.md) | When fallback is not payable you will not be able to receive ethers. | ✔️ |
Expand All @@ -34,7 +35,7 @@ title: "Rule Index of Solhint"
| [const-name-snakecase](./rules/naming/const-name-snakecase.md) | Constant name must be in capitalized SNAKE_CASE. | ✔️ |
| [contract-name-camelcase](./rules/naming/contract-name-camelcase.md) | Contract name must be in CamelCase. | ✔️ |
| [event-name-camelcase](./rules/naming/event-name-camelcase.md) | Event name must be in CamelCase. | ✔️ |
| [func-name-mixedcase](./rules/naming/func-name-mixedcase.md) | Function name must be in camelCase. | ✔️ |
| [func-name-mixedcase](./rules/naming/func-name-mixedcase.md) | Function name must be in mixedCase. | ✔️ |
| [func-param-name-mixedcase](./rules/naming/func-param-name-mixedcase.md) | Function param name must be in mixedCase | |
| [modifier-name-mixedcase](./rules/naming/modifier-name-mixedcase.md) | Modifier name must be in mixedCase. | |
| [private-vars-leading-underscore](./rules/naming/private-vars-leading-underscore.md) | Private and internal names must start with a single underscore. | |
Expand Down Expand Up @@ -64,7 +65,7 @@ title: "Rule Index of Solhint"
| [no-complex-fallback](./rules/security/no-complex-fallback.md) | Fallback function must be simple. | ✔️ |
| [no-inline-assembly](./rules/security/no-inline-assembly.md) | Avoid to use inline assembly. It is acceptable only in rare cases. | ✔️ |
| [not-rely-on-block-hash](./rules/security/not-rely-on-block-hash.md) | Do not rely on "block.blockhash". Miners can influence its value. | ✔️ |
| [not-rely-on-time](./rules/security/not-rely-on-time.md) | Avoid making time-based decisions in your business logic. | ✔️ |
| [not-rely-on-time](./rules/security/not-rely-on-time.md) | Avoid making time-based decisions in your business logic. | ✔️ |
| [reentrancy](./rules/security/reentrancy.md) | Possible reentrancy vulnerabilities. Avoid state changes after transfer. | ✔️ |
| [state-visibility](./rules/security/state-visibility.md) | Explicitly mark visibility of state. | ✔️ |
Expand Down
59 changes: 59 additions & 0 deletions docs/rules/best-practises/no-console.md
@@ -0,0 +1,59 @@
---
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
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)
![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.
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.

## Description
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.

### Example Config
```json
{
"rules": {
"no-console": "error"
}
}
```


## Examples
### 👎 Examples of **incorrect** code for this rule

#### No console.logX statements

```solidity
console.log('test')
```

#### No hardhat/console.sol import statements

```solidity
import "hardhat/console.sol"
```

#### No forge-std console.sol & console2.sol import statements

```solidity
import "forge-std/consoleN.sol"
```

## Version
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)
2 changes: 1 addition & 1 deletion docs/rules/miscellaneous/comprehensive-interface.md
Expand Up @@ -9,7 +9,7 @@ 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 useful to make sure that the whole API is extracted in an interface.
Check that all public or external functions are override. This is iseful 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.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/naming/func-name-mixedcase.md
Expand Up @@ -12,7 +12,7 @@ title: "func-name-mixedcase | Solhint"

## Description
Function name must be in camelCase.
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.
Expand Down

0 comments on commit a2b8ea3

Please sign in to comment.