Skip to content

Commit

Permalink
[docs]update module file name recommendation (#8463)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgfm999 authored and banool committed Jul 7, 2023
1 parent 9da9ec9 commit 9838544
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion developer-docs-site/docs/move/book/coding-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This section lays out some basic coding conventions for Move that the Move team
- **Constant names**: should be upper camel case and begin with an `E` if they represent error codes (e.g., `EIndexOutOfBounds`) and upper snake case if they represent a non-error value (e.g., `MIN_STAKE`).
-
- **Generic type names**: should be descriptive, or anti-descriptive where appropriate, e.g., `T` or `Element` for the Vector generic type parameter. Most of the time the "main" type in a module should be the same name as the module e.g., `option::Option`, `fixed_point32::FixedPoint32`.
- **Module file names**: should be the same as the module name e.g., `Option.move`.
- **Module file names**: should be the same as the module name e.g., `option.move`.
- **Script file names**: should be lower snake case and should match the name of the “main” function in the script.
- **Mixed file names**: If the file contains multiple modules and/or scripts, the file name should be lower snake case, where the name does not match any particular module/script inside.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This section lays out some basic coding conventions for Move that the Move team
- **Constant names**: should be upper camel case and begin with an `E` if they represent error codes (e.g., `EIndexOutOfBounds`) and upper snake case if they represent a non-error value (e.g., `MIN_STAKE`).
-
- **Generic type names**: should be descriptive, or anti-descriptive where appropriate, e.g., `T` or `Element` for the Vector generic type parameter. Most of the time the "main" type in a module should be the same name as the module e.g., `option::Option`, `fixed_point32::FixedPoint32`.
- **Module file names**: should be the same as the module name e.g., `Option.move`.
- **Module file names**: should be the same as the module name e.g., `option.move`.
- **Script file names**: should be lower snake case and should match the name of the “main” function in the script.
- **Mixed file names**: If the file contains multiple modules and/or scripts, the file name should be lower snake case, where the name does not match any particular module/script inside.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- **函数名称**:应该使用小写的蛇形命名法,例如:`destroy_empty`
- **常量名称**:应该使用大写的蛇形命名法,例如:`REQUIRES_CAPABILITY`
- 泛型类型应该具备描述性,当然在适当的情况下也可以是反描述性的,例如:Vector 泛型类型的参数可以是 `T``Element`。大多数情况下,模块中的“主”类型命名应该与模块名相同,例如:`option::Option``fixed_point32::FixedPoint32`
- **模块文件名称**:应该与模块名相同,例如:`Option.move`
- **模块文件名称**:应该与模块名相同,例如:`option.move`
- **脚本文件名称**:应该使用小写的蛇形命名法,并且应该与脚本中的“主”函数名匹配。
- **混合文件名称**:如果文件包含多个模块和/或脚本,文件命名应该使用小写的蛇形命名法,并且不需要与内部的任何特定模块/脚本名匹配。

Expand Down

0 comments on commit 9838544

Please sign in to comment.