diff --git a/devel/Develop_on_Linux.md b/devel/Develop_on_Linux.md index 5555709bef..7a4c0239ea 100644 --- a/devel/Develop_on_Linux.md +++ b/devel/Develop_on_Linux.md @@ -5,17 +5,17 @@ On Debian or Debian derivatives: Since the project uses xmake to manage Qt, you need to remove the local Qt installation: -``` bash +```bash sudo apt remove qt6-base-dev qt6-base-dev-tools qmake6 ``` If you encounter Qt dependency issues, you can use this command to delete xmake's Qt global cache: -``` bash +```bash rm -rf ~/.xmake/cache ~/.xmake/packages/qt ``` Install xmake and related dependencies: -``` bash +```bash sudo apt install xmake sudo apt update @@ -23,14 +23,14 @@ sudo apt install -y gcc git 7zip unzip curl build-essential fonts-noto-cjk libcu ``` Keep xrepo updated: -``` bash +```bash xrepo update-repo ``` ### Step 2: Compile -vD shows detailed debug logs. Qt installation cache is located at: /home/username/.xmake/packages For example: /home/jiadong/.xmake/packages/q/qt6base/6.8.3/7c1ea54729db483fa6eee7744bd4a333 -``` bash +```bash xmake config --yes -vD xmake build stem ``` @@ -39,27 +39,27 @@ xmake build stem Refer to [How to Test](Test_EN.md) ### Step 4: Launch Mogan STEM -``` bash +```bash xmake run stem ``` ### In some case, clearing the cache may be necessary (eg., when manu bar disappears, etc.) Cache directory: -``` bash +```bash rm -rf ~/.cache/MoganLab ``` Runtime cache: -``` bash +```bash rm -rf ~/.local/share/moganlab ``` ### Using VSCode for code completion assistance Install VSCode, Clangd, and the Clangd extension for VSCode. Then execute the following command in the mogan folder: -``` bash +```bash xmake project -k compile_commands ``` This command will generate a compile_commands.json file in the mogan folder. Clangd reads this file to understand the project's structure, thereby avoiding errors related to missing header files. ## Please format code before committing -[Formatting Guide](Format_EN.md) \ No newline at end of file +[Formatting Guide](Format_EN.md) diff --git a/devel/Develop_on_Windows.md b/devel/Develop_on_Windows.md index 353b90613f..f328898b72 100644 --- a/devel/Develop_on_Windows.md +++ b/devel/Develop_on_Windows.md @@ -21,14 +21,14 @@ - **chocolatey**: ```powershell - choco install xmake + choco install xmake ``` - Verify: ```powershell xmake --version ``` ## Step 2: Get Source Code, Compile and Run -### Chose your working directory, for example E:\TestFile: +### Choose your working directory, for example E:\TestFile: ```powershell cd E:\TestFile diff --git a/devel/Develop_on_macOS.md b/devel/Develop_on_macOS.md index c0087cedbb..8efc088670 100644 --- a/devel/Develop_on_macOS.md +++ b/devel/Develop_on_macOS.md @@ -3,34 +3,34 @@ This development guide is written for Mogan Research. Other components can also ## Step 1: Install xmake and xrepo For Homebrew users: -``` bash +```bash brew install xmake qt brew install pkg-config ``` Keep xrepo updated: -``` bash +```bash xrepo update-repo ``` ## Step 2: Configuration -``` bash +```bash xmake config -vD --yes ``` If you encounter Qt dependency issues, you can use this command to delete xmake's Qt global cache: -``` bash +```bash rm -rf ~/.xmake/cache ~/.xmake/packages/qt ``` If Qt cannot be found, you can manually specify the Qt path, for example: -``` bash +```bash xmake config --qt=/opt/homebrew/share/qt ``` Please adjust the Qt-related directory as needed; it may not necessarily be `/opt/homebrew/share/qt`. ## Step 3: Build -``` bash +```bash xmake build stem ``` @@ -38,9 +38,9 @@ xmake build stem Refer to [How to Test](Test_EN.md) ## Step 5: Launch Mogan STEM -``` bash +```bash xmake run stem ``` ## Please format code before committing -[Formatting Guide](Format_EN.md) \ No newline at end of file +[Formatting Guide](Format_EN.md) diff --git a/devel/Format_EN.md b/devel/Format_EN.md index cf8099d955..51cd42372b 100644 --- a/devel/Format_EN.md +++ b/devel/Format_EN.md @@ -1,46 +1,56 @@ # Code Formatting Guide ## Environment Setup + Requires clang-format version 19.1.x. ### Linux + Install via apt: -``` +```bash sudo apt install clang-format-19 ``` + After restarting the terminal, verify: -``` +```bash clang-format-19 --version ``` ### macOS + Note: should match LLVM 19. + Install via Homebrew: -``` +```bash brew install llvm@19 ``` + Add to your ~/.zshrc: -``` +```bash # set clang-format to version 19 export PATH="$(brew --prefix llvm@19)/bin:$PATH" ``` + Restart the terminal and verify: -``` +```bash clang-format --version ``` ### Windows + Install via scoop: -``` +```bash scoop install llvm@19.1.0 ``` + Restart the terminal and verify: -``` +```bash clang-format --version ``` ## Using the script + From the repository root, run: -``` +```shell elvish bin/format -``` \ No newline at end of file +```