Ana içeriğe geç
Bu sayfa henüz Türkçeye çevrilmedi; İngilizce sürümü gösteriliyor.
Versiyon: 1.0

Contributing

Kabuk changes how the Windows desktop behaves while it runs, on a machine someone uses every day. The rules below keep that machine safe and keep the code consistent.

Environment​

  • Windows 11. The Win32 code cannot be tested on Linux or in a cloud sandbox.
  • Rust stable (x86_64-pc-windows-msvc), Visual Studio Build Tools (C++ workload and Windows SDK), WebView2 Runtime (part of Windows 11), and Node.js (only for the design tools and the settings page test).

See Installation for the build command.

Run the checks​

Before you send a change, run:

powershell -ExecutionPolicy Bypass -File tools/check.ps1

This runs cargo fmt, clippy with warnings as errors, the unit tests and the Windows integration tests. The integration tests run the real shell on your desktop for a few seconds at a time, so expect test windows and bars to come and go while they run. The test rules are in docs/TESTING.md.

Safety rules: never leave the machine locked up​

  1. Nothing hides windows, hides the taskbar or changes the work area unless the watchdog and the emergency restore work.
  2. The emergency exit always works: kabuk --restore and Ctrl+Alt+Shift+End show every hidden window, bring the taskbar back and reset the work area.
  3. The handle of every window Kabuk hides is written to the state file (%LOCALAPPDATA%\kabuk\state.json) before it is hidden, so it comes back after a crash.
  4. No code is injected into other processes and no global DLL hook is installed. SetWinEventHook is used only with WINEVENT_OUTOFCONTEXT. Games with anti-cheat must not break.
  5. Every registry value Kabuk changes is backed up first and written back on exit.

Code rules​

  • Rust 2021; cargo fmt and cargo clippy --all-targets -- -D warnings clean. unsafe blocks are small and each has a // SAFETY: comment above it saying why it is safe.
  • Win32 calls live behind safe wrappers in kabuk-win; application code does not call the raw windows crate.
  • Platform-independent logic (layout, configuration, search, contrast, translation) lives in its own crates as pure functions with unit tests.
  • Code, comments, logs, commit messages and documentation are in English. Turkish appears only in locales/tr.ftl and in quoted Turkish UI or test examples. Every user-visible string comes from locales/; no UI text is hard-coded.
  • No magic numbers: sizes, durations and colours are theme or configuration values.
  • Before you invent a new pattern, look for one in the codebase that already does the job and follow it.
  • Idle CPU stays close to zero: nothing draws on a timer, only when something changes.

Done means​

  1. Tests are written and tools/check.ps1 passes. Every behaviour has a test, every bug is first caught by a failing test, no test is skipped, and no expected value is changed to match the actual result.
  2. The changed behaviour was tried by running it; anything visual was compared with the design.
  3. A new setting is wired end to end: schema, reading, applying, Settings, translations (Turkish and English) and live reload.
  4. Anything left undone is written down. Nothing is skipped quietly.

Keep commits small and about one thing. Commit messages are in English, in the imperative mood ("Add", not "Added").

License​

Kabuk is licensed under the Apache License 2.0.