mirror of
https://github.com/microsoft/edit.git
synced 2025-12-23 07:07:25 +00:00
2.1 KiB
2.1 KiB
Repository Guidelines
Project Structure & Module Organization
src/: core Rust crates for the editor (bin/editfor the terminal app,buffer,tui,framebuffer, etc.). Start fromsrc/bin/edit/main.rsfor entry flow, andsrc/bin/edit/state.rsfor global state/preferences.i18n/: localization sources (edit.toml) compiled intosrc/bin/edit/localization.rs.assets/: icons, branding, and misc resources bundled with releases.scripts/: helper executables; preferscripts/*.shover raw cargo commands to match CI settings.
Build, Test, and Development Commands
scripts/build-debug.sh– debug build (cargo build).scripts/build-release.sh– release build with nightly config (cargo build --config .cargo/release-nightly.toml --release).scripts/test.sh [-- <args>]– runcargo test.scripts/check.sh–cargo check(fast validation).scripts/install.sh–cargo install --path . --locked; installseditinto~/.cargo/bin.
Coding Style & Naming Conventions
- Use
cargo fmt(already configured viarustfmt.toml); check formatting before committing. - Modules follow snake_case; types use UpperCamelCase; constants use SCREAMING_SNAKE.
- Prefer
arena_format!for UI strings needing formatting; keep UIclassnames stable for the TUI diffing algorithm.
Testing Guidelines
- Tests leverage Rust’s standard
cargo testrunner; integration tests live alongside modules. - Add
#[test]functions near the functionality they cover; name astest_<feature>_<case>. - For rendering or UI changes, add snapshot/debug logs where possible and describe manual test steps in PRs.
Commit & Pull Request Guidelines
- Commit messages mirror existing history: concise imperative summary (e.g., “Add preferences dialog with colorschemes”).
- PRs should include: purpose/summary, key changes, testing performed (
cargo check,scripts/test.sh, manual steps), and screenshots for UI shifts. - Reference related issues (
Fixes #123) when applicable, and keep PRs focused; split large features into iterative commits when possible.