Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Spec 命名风格约束 #181

Open
hyj1991 opened this issue Aug 25, 2022 · 1 comment
Open

[RFC] Spec 命名风格约束 #181

hyj1991 opened this issue Aug 25, 2022 · 1 comment
Assignees

Comments

@hyj1991
Copy link
Member

hyj1991 commented Aug 25, 2022

目前在 core 的代码中,变量名基本都遵循了小驼峰规则,常量在这一块相对比较混乱,

比如 enum 有大驼峰命名:

export enum ArtusInjectEnum {
  Application = 'artus#application',
  Config = 'artus#config',
  DefaultContainerName = 'artus#default_container',
  Frameworks = 'artus#framework-config',
  LifecycleManager = 'artus#lifecycle-manager',
  Logger = 'artus#logger',
  Packages = 'artus#packages',
  Trigger = 'artus#trigger',
}

有下划线大写命名:

export enum ARTUS_DEFAULT_CONFIG_ENV {
  DEV = 'development',
  PROD = 'production',
  DEFAULT = 'default',
}

对于常量字符串则相对统一,都是下划线大写规则:

export const ARTUS_EXCEPTION_DEFAULT_LOCALE = 'en';

这里需要在 spec 中补充一份变成风格指南,约束:

  • 常量
  • enum
  • 函数
  • 变量

以上元素的命令基本风格,以便后续实现的风格统一。

@hyj1991 hyj1991 changed the title [RFC] 常量名和变量名的风格统一 [RFC] Spec Aug 25, 2022
@hyj1991 hyj1991 changed the title [RFC] Spec [RFC] Spec 命名风格约束 Aug 25, 2022
@hyj1991
Copy link
Member Author

hyj1991 commented Aug 25, 2022

cc @noahziheng @DuanPengfei @atian25 @JerrysShan

@hyj1991 hyj1991 self-assigned this Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant