Skip to content

Commit

Permalink
Improve options documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
touhonoob committed Aug 25, 2019
1 parent 36d3138 commit 6eecc7f
Show file tree
Hide file tree
Showing 55 changed files with 668 additions and 135 deletions.
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "Rule Index of Solhint"
date: "Sat, 24 Aug 2019 10:42:48 GMT"
date: "Sun, 25 Aug 2019 22:09:23 GMT"
author: "Peter Chung <[email protected]>"
---

Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/array-declaration-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "array-declaration-spaces | Solhint"
date: "Sat, 24 Aug 2019 03:06:48 GMT"
date: "Sun, 25 Aug 2019 22:09:14 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Array declaration must not contains spaces.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"array-declaration-spaces": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/bracket-align.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "bracket-align | Solhint"
date: "Sat, 24 Aug 2019 03:06:48 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Open bracket must be on same line. It must be indented by other constructions by space.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"bracket-align": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/expression-indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "expression-indent | Solhint"
date: "Sat, 24 Aug 2019 03:06:49 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Expression indentation is incorrect.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"expression-indent": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
20 changes: 15 additions & 5 deletions docs/rules/align/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "indent | Solhint"
date: "Sat, 24 Aug 2019 03:06:49 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -21,10 +21,20 @@ Indentation is incorrect.
## Options
This rule accepts an array of options:

| Index | Description | Default Value |
| ----- | ---------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn". | error |
| 1 | Number of indents | 4 |
| Index | Description | Default Value |
| ----- | ----------------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn", "off". | error |
| 1 | Number of indents | 4 |


### Example Config
```json
{
"rules": {
"indent": ["error",4]
}
}
```


## Examples
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/no-mix-tabs-and-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "no-mix-tabs-and-spaces | Solhint"
date: "Sat, 24 Aug 2019 03:06:49 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Mixed tabs and spaces.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"no-mix-tabs-and-spaces": "warn"
}
}
```


## Examples
### 👎 Examples of **incorrect** code for this rule
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/no-spaces-before-semicolon.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "no-spaces-before-semicolon | Solhint"
date: "Sat, 24 Aug 2019 10:42:48 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Semicolon must not have spaces before.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"no-spaces-before-semicolon": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/space-after-comma.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "space-after-comma | Solhint"
date: "Sat, 24 Aug 2019 03:06:49 GMT"
date: "Sun, 25 Aug 2019 22:09:15 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Comma must be separated from next element by space.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"space-after-comma": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/align/statement-indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "statement-indent | Solhint"
date: "Sat, 24 Aug 2019 03:06:49 GMT"
date: "Sun, 25 Aug 2019 22:09:16 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -17,7 +17,17 @@ author: "Peter Chung <[email protected]>"
Statement indentation is incorrect.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"statement-indent": "warn"
}
}
```


## Examples
### 👍 Examples of **correct** code for this rule
Expand Down
20 changes: 15 additions & 5 deletions docs/rules/best-practises/code-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "code-complexity | Solhint"
date: "Sat, 24 Aug 2019 03:06:50 GMT"
date: "Sun, 25 Aug 2019 22:09:16 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -16,10 +16,20 @@ Function has cyclomatic complexity "current" but allowed no more than maxcompl.
## Options
This rule accepts an array of options:

| Index | Description | Default Value |
| ----- | ---------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn". | warn |
| 1 | Maximum allowed cyclomatic complexity | 7 |
| Index | Description | Default Value |
| ----- | ----------------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn", "off". | warn |
| 1 | Maximum allowed cyclomatic complexity | 7 |


### Example Config
```json
{
"rules": {
"code-complexity": ["warn",7]
}
}
```


## Examples
Expand Down
14 changes: 12 additions & 2 deletions docs/rules/best-practises/constructor-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "constructor-syntax | Solhint"
date: "Sat, 24 Aug 2019 03:06:51 GMT"
date: "Sun, 25 Aug 2019 22:09:17 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -14,7 +14,17 @@ author: "Peter Chung <[email protected]>"
Constructors should use the new constructor keyword.

## Options
This rule does not have options.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Default to warn.

### Example Config
```json
{
"rules": {
"constructor-syntax": "warn"
}
}
```


## Examples
This rule does not have examples.
Expand Down
20 changes: 15 additions & 5 deletions docs/rules/best-practises/function-max-lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "function-max-lines | Solhint"
date: "Sat, 24 Aug 2019 03:06:50 GMT"
date: "Sun, 25 Aug 2019 22:09:16 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -16,10 +16,20 @@ Function body contains "count" lines but allowed no more than maxlines.
## Options
This rule accepts an array of options:

| Index | Description | Default Value |
| ----- | ---------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn". | warn |
| 1 | Maximum allowed lines count per function | 50 |
| Index | Description | Default Value |
| ----- | ----------------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn", "off". | warn |
| 1 | Maximum allowed lines count per function | 50 |


### Example Config
```json
{
"rules": {
"function-max-lines": ["warn",50]
}
}
```


## Examples
Expand Down
20 changes: 15 additions & 5 deletions docs/rules/best-practises/max-line-length.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "max-line-length | Solhint"
date: "Sat, 24 Aug 2019 03:06:50 GMT"
date: "Sun, 25 Aug 2019 22:09:16 GMT"
author: "Peter Chung <[email protected]>"
---

Expand All @@ -18,10 +18,20 @@ Line length must be no more than maxlen.
## Options
This rule accepts an array of options:

| Index | Description | Default Value |
| ----- | ---------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn". | error |
| 1 | Maximum allowed number of characters per line | 120 |
| Index | Description | Default Value |
| ----- | ----------------------------------------------------- | ------------- |
| 0 | Rule severity. Must be one of "error", "warn", "off". | error |
| 1 | Maximum allowed number of characters per line | 120 |


### Example Config
```json
{
"rules": {
"max-line-length": ["error",120]
}
}
```


## Examples
Expand Down
Loading

0 comments on commit 6eecc7f

Please sign in to comment.