From ac6a699a3c62297707d600559c9b5f719fc6c7be Mon Sep 17 00:00:00 2001 From: liuhui Date: Thu, 26 May 2022 15:43:30 +0800 Subject: [PATCH] fix: fix variable typo Signed-off-by: liuhui --- en/application-dev/ui/ts-syntactic-sugar.md | 2 +- en/contribute/OpenHarmony-c-coding-style-guide.md | 8 ++++---- en/contribute/OpenHarmony-cpp-coding-style-guide.md | 8 ++++---- zh-cn/contribute/OpenHarmony-c-coding-style-guide.md | 8 ++++---- zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/en/application-dev/ui/ts-syntactic-sugar.md b/en/application-dev/ui/ts-syntactic-sugar.md index 4f367db9ee..cd3a802070 100644 --- a/en/application-dev/ui/ts-syntactic-sugar.md +++ b/en/application-dev/ui/ts-syntactic-sugar.md @@ -130,7 +130,7 @@ build() { let a: number = 1 // invalid: variable declaration not allowed Column() { Text('Hello ${this.myName.toUpperCase()}') // ok. - ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array varible in place + ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array variable in place } buildSpecial() // invalid: no function calls Text(this.calcTextValue()) // this function call is ok. diff --git a/en/contribute/OpenHarmony-c-coding-style-guide.md b/en/contribute/OpenHarmony-c-coding-style-guide.md index 47fd708789..c63b38e5e9 100755 --- a/en/contribute/OpenHarmony-c-coding-style-guide.md +++ b/en/contribute/OpenHarmony-c-coding-style-guide.md @@ -577,11 +577,11 @@ int result = reallyReallyLongVariableName1 + // Good: The plus sign is placed After an expression is wrapped, ensure that the lines are properly aligned or indented by 4 spaces. Example: ```c -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: indented with 4 spaces +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: indented with 4 spaces -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: aligned +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: aligned ``` ## Variable Assignment diff --git a/en/contribute/OpenHarmony-cpp-coding-style-guide.md b/en/contribute/OpenHarmony-cpp-coding-style-guide.md index e599a3d5d1..ee0dc81975 100755 --- a/en/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/en/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good After an expression is wrapped, ensure that the lines are aligned appropriately or indented with 4 spaces. See the following example. ```cpp -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: indented with 4 spaces +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: indented with 4 spaces -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: The lines are aligned. +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: The lines are aligned. ``` ## Variable Assignment diff --git a/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md index bd1e50054a..87a81c38be 100755 --- a/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md @@ -540,11 +540,11 @@ int result = reallyReallyLongVariableName1 + // Good: 加号留在行末 表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子 ```c -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 4空格缩进 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: 4空格缩进 -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 保持对齐 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: 保持对齐 ``` ## 变量赋值 diff --git a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md index 06cae9de85..8f56e3cf7d 100755 --- a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good 表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子 ```cpp -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 4空格缩进 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: 4空格缩进 -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 保持对齐 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: 保持对齐 ``` ## 变量赋值 -- GitLab