Skip to content

Commit 8da24bf

Browse files
author
shijiashuai
committed
chore: 统一代码格式并添加项目配置
- 添加 package.json:定义项目元数据和 npm scripts - 添加 .github/workflows/validate.yml:CI 自动验证 - 添加 .editorconfig:统一编辑器行为 - 统一 11 个文件的 globs 格式:移除不必要的引号 - 修复 5 个文件的 trailing whitespace 验证通过:Checked 26 files: 0 errors, 0 warnings
1 parent 527de28 commit 8da24bf

18 files changed

Lines changed: 94 additions & 22 deletions

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 2
10+
11+
[*.mdc]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.{js,mjs}]
19+
indent_style = space
20+
indent_size = 2

.github/workflows/validate.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Validate Rules
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
22+
- name: Validate rule files
23+
run: node scripts/validate-rules.mjs

android.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 使用 Kotlin 进行现代 Android 开发的最佳实践和模式
3-
globs: "**/*.kt", "app/src/main/java/**/*.kt"
3+
globs: **/*.kt, app/src/main/java/**/*.kt
44
---
55

66
# Android (Kotlin) 最佳实践

clean-code.mdc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 编写干净、可维护且易于人类阅读的代码的指南。在编写或审查代码时应用这些规则,以确保一致性和质量。
3-
globs:
3+
globs:
44
---
55
# 整洁代码指南
66

@@ -52,4 +52,4 @@ globs:
5252
## 版本控制
5353
- 编写清晰的提交信息
5454
- 进行小而专注的提交
55-
- 使用有意义的分支名称
55+
- 使用有意义的分支名称

codequality.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 代码质量指南
3-
globs:
3+
globs:
44
---
55
# 代码质量指南
66

cpp.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 现代 C++ 编程的最佳实践、命名规范和代码模式
3-
globs: "**/*.c,**/*.cpp,**/*.h,**/*.hpp,**/*.cxx,CMakeLists.txt,*.cmake,conanfile.txt,Makefile,**/*.cc"
3+
globs: **/*.c,**/*.cpp,**/*.h,**/*.hpp,**/*.cxx,CMakeLists.txt,*.cmake,conanfile.txt,Makefile,**/*.cc
44
---
55
# C++ 编程指南
66

csharp-dotnet.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 使用 C# 和 .NET 的现代软件开发最佳实践和模式
3-
globs: "**/*.cs", "src/**/*.cs"
3+
globs: **/*.cs, src/**/*.cs
44
---
55

66
# C# 和 .NET 最佳实践

docker.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 编写高效、安全的 Dockerfile 的最佳实践
3-
globs: "**/Dockerfile"
3+
globs: **/Dockerfile
44
---
55

66
# Dockerfile 最佳实践

gitflow.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Gitflow 工作流规则。在执行 git 操作时应应用这些规则。
3-
globs:
3+
globs:
44
---
55
# Gitflow 工作流规则
66

@@ -32,7 +32,7 @@ globs:
3232

3333
### release/*
3434
- 分支来源: develop
35-
- 合并回:
35+
- 合并回:
3636
- main
3737
- develop
3838
- 命名约定: release/vX.Y.Z
@@ -109,4 +109,4 @@ globs:
109109
5. 合并到 main 后:
110110
- 标记发布版本
111111
- 合并回 develop
112-
- 删除 hotfix 分支
112+
- 删除 hotfix 分支

go.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 现代软件开发的 Go (Golang) 最佳实践和模式
3-
globs: "**/*.go", "cmd/**/*.go", "pkg/**/*.go"
3+
globs: **/*.go, cmd/**/*.go, pkg/**/*.go
44
---
55

66
# Go (Golang) 最佳实践

0 commit comments

Comments
 (0)