-
Notifications
You must be signed in to change notification settings - Fork 4
docs(guide): 添加仓库开发指南文档 #120
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Repository Guidelines | ||
|
|
||
| ## Project Structure & Module Organization | ||
|
|
||
| `GFramework.sln` is the entry point for the full .NET solution. Runtime code lives in `GFramework.Core/`, | ||
| `GFramework.Game/`, `GFramework.Godot/`, and `GFramework.Ecs.Arch/`. Interface-only contracts stay in the paired | ||
| `*.Abstractions/` projects. Roslyn generators are split across `GFramework.SourceGenerators/`, | ||
| `GFramework.Godot.SourceGenerators/`, and `GFramework.SourceGenerators.Common/`. Tests mirror the runtime modules in | ||
| `GFramework.Core.Tests/`, `GFramework.Game.Tests/`, `GFramework.Ecs.Arch.Tests/`, and | ||
| `GFramework.SourceGenerators.Tests/`. Documentation is under `docs/`, Godot templates under `Godot/script_templates/`, | ||
| and repository utilities under `scripts/` and `refactor-scripts/`. | ||
|
|
||
| ## Build, Test, and Development Commands | ||
|
|
||
| - `dotnet build GFramework.sln` builds the full solution from the repo root. | ||
| - `dotnet test GFramework.sln --no-build` runs all NUnit test projects after a build. | ||
| - `dotnet test GFramework.Core.Tests --filter "FullyQualifiedName~CommandExecutorTests.Execute"` runs a focused NUnit | ||
| test. | ||
| - `bash scripts/validate-csharp-naming.sh` checks PascalCase namespace and directory rules used by CI. | ||
| - `cd docs && bun install && bun run dev` starts the VitePress docs site locally. | ||
|
|
||
| ## Coding Style & Naming Conventions | ||
|
|
||
| Use standard C# formatting with 4-space indentation and one public type per file. The repository keeps `ImplicitUsings` | ||
| disabled and `Nullable` enabled, so write explicit `using` directives and annotate nullability carefully. Follow | ||
| `PascalCase` for types, methods, namespaces, directories, and constants; use `_camelCase` for private fields and | ||
| `camelCase` for locals and parameters. Keep namespaces aligned with folders, for example | ||
| `GFramework.Core.Architectures`. | ||
|
|
||
| ## Testing Guidelines | ||
|
|
||
| Tests use NUnit 4 with `Microsoft.NET.Test.Sdk`; some suites also use Moq. Place tests in the matching module test | ||
| project and name files `*Tests.cs`. Prefer directory parity with production code, for example `GFramework.Core/Logging/` | ||
| and `GFramework.Core.Tests/Logging/`. Add or update tests for every behavior change, especially public APIs, source | ||
| generators, and integration paths. | ||
|
|
||
| ## Commit & Pull Request Guidelines | ||
|
|
||
| Recent history follows Conventional Commit style such as `feat(events): ...`, `refactor(localization): ...`, | ||
| `docs(guide): ...`, and `test(localization): ...`. Keep commits scoped and imperative. PRs should explain the | ||
| motivation, implementation, and validation commands run; link related issues; and include screenshots when docs, UI, or | ||
| Godot-facing behavior changes. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.