Skip to content

Commit 3266bcb

Browse files
authored
Merge pull request #303 from Peefy/indexsignature-code-style
docs: add code style for schema index signatures
2 parents b1a8b9b + 606ca48 commit 3266bcb

File tree

6 files changed

+68
-4
lines changed

6 files changed

+68
-4
lines changed

blog/2024-02-05-lfx-guide/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tags: [KCL, LFX-Mentorship]
99

1010
[KCL](https://github.com/kcl-lang) is a constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF) that enhances the writing of complex configurations, including those for cloud-native scenarios. With its advanced programming language technology and practices, KCL is dedicated to promoting better modularity, scalability, and stability for configurations. It enables simpler logic writing and offers ease of automation APIs and integration with homegrown systems.
1111

12-
**_KCL Website: [https://kcl-lang.io](https://kcl-lang.io)_**\
13-
**_KCL Github Repo: [https://github.com/kcl-lang](https://github.com/kcl-lang)_**
12+
+ **_KCL Website: [https://kcl-lang.io](https://kcl-lang.io)_**
13+
+ **_KCL Github Repo: [https://github.com/kcl-lang](https://github.com/kcl-lang)_**
1414

1515
For those interested in cloud-native, platform engineering,compiler, package management tools, and IDEs, we invite you to apply for the 2024 Spring Linux Foundation LFX Mentorship project. You can earn a minimum of $3000 for completing the project! Apply now!
1616

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-blog/2024-02-05-lfx-guide/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tags: [KCL, Biweekly-Newsletter]
99

1010
[KCL](https://github.com/kcl-lang) 是一个 CNCF 基金会托管的基于约束的记录及函数语言,期望通过成熟的编程语言技术和实践来改进对大量繁杂配置比如云原生 Kubernetes 配置场景的编写,致力于构建围绕配置的更好的模块化、扩展性和稳定性,更简单的逻辑编写,以及更简单的自动化和生态工具集成。
1111

12-
**_KCL 官网:[https://kcl-lang.io](https://kcl-lang.io)_**\
13-
**_KCL Github 仓库:[https://github.com/kcl-lang](https://github.com/kcl-lang)_**
12+
+ **_KCL 官网:[https://kcl-lang.io](https://kcl-lang.io)_**
13+
+ **_KCL Github 仓库:[https://github.com/kcl-lang](https://github.com/kcl-lang)_**
1414

1515
对云原生、平台工程、语言编译器、语言包管理工具和语言 IDE 感兴趣的小伙伴,我们邀请你申请 KCL 的 2024 春季 Linux 基金会 LFX Mentorship 项目,完成项目有最低 3000 美金的奖励哦!快来申请吧!
1616

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)