Skip to content

Commit a5f8727

Browse files
committed
docs: add code style for schema index signatures
Signed-off-by: peefy <xpf6677@163.com>
1 parent b1a8b9b commit a5f8727

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

docs/reference/lang/spec/codestyle.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,22 @@ print("", end='') # recommended
572572
print("", end = '') # non-recommended
573573
```
574574

575+
### Index Signature
576+
577+
- It is recommended to place the schema index signature before the schema attribute instead of mixed placement.
578+
579+
```python
580+
schema ConfigReCommended:
581+
[...str]: str # recommended
582+
name: str
583+
image: str
584+
585+
schema ConfigNonReCommended:
586+
name: str
587+
[...str]: str # non-recommended
588+
image: str
589+
```
590+
575591
## Keywords
576592

577593
- Only one space is usually reserved around the keyword, such as `schema`, `mixin`, `is` and `not`, etc.

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/lang/spec/codestyle.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,22 @@ print("", end='') # recommended
572572
print("", end = '') # non-recommended
573573
```
574574

575+
### Index Signature
576+
577+
- It is recommended to place the schema index signature before the schema attribute instead of mixed placement.
578+
579+
```python
580+
schema ConfigReCommended:
581+
[...str]: str # recommended
582+
name: str
583+
image: str
584+
585+
schema ConfigNonReCommended:
586+
name: str
587+
[...str]: str # non-recommended
588+
image: str
589+
```
590+
575591
## Keywords
576592

577593
- Only one space is usually reserved around the keyword, such as `schema`, `mixin`, `is` and `not`, etc.

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8.0/reference/lang/spec/codestyle.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,22 @@ print("", end='') # recommended
572572
print("", end = '') # non-recommended
573573
```
574574

575+
### Index Signature
576+
577+
- It is recommended to place the schema index signature before the schema attribute instead of mixed placement.
578+
579+
```python
580+
schema ConfigReCommended:
581+
[...str]: str # recommended
582+
name: str
583+
image: str
584+
585+
schema ConfigNonReCommended:
586+
name: str
587+
[...str]: str # non-recommended
588+
image: str
589+
```
590+
575591
## Keywords
576592

577593
- Only one space is usually reserved around the keyword, such as `schema`, `mixin`, `is` and `not`, etc.

versioned_docs/version-0.8.0/reference/lang/spec/codestyle.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,22 @@ print("", end='') # recommended
572572
print("", end = '') # non-recommended
573573
```
574574

575+
### Index Signature
576+
577+
- It is recommended to place the schema index signature before the schema attribute instead of mixed placement.
578+
579+
```python
580+
schema ConfigReCommended:
581+
[...str]: str # recommended
582+
name: str
583+
image: str
584+
585+
schema ConfigNonReCommended:
586+
name: str
587+
[...str]: str # non-recommended
588+
image: str
589+
```
590+
575591
## Keywords
576592

577593
- Only one space is usually reserved around the keyword, such as `schema`, `mixin`, `is` and `not`, etc.

0 commit comments

Comments
 (0)