Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ビルドとテスト

前提条件

  • Rust 1.85 以降(edition 2024)
  • Cargo(Rust に付属)
  • protobuf コンパイラprotoc)– laurus-server のビルドに必要

ビルド

# すべてのクレートをビルド
cargo build

# 特定の Feature を指定してビルド
cargo build --features embeddings-candle

# リリースモードでビルド
cargo build --release

テスト

# すべてのテストを実行
cargo test

# 名前を指定して特定のテストを実行
cargo test <test_name>

# 特定のクレートのテストを実行
cargo test -p laurus
cargo test -p laurus-cli
cargo test -p laurus-server

Lint

# clippy を警告エラー扱いで実行
cargo clippy -- -D warnings

フォーマット

# フォーマットチェック
cargo fmt --check

# フォーマットを適用
cargo fmt

ドキュメント

API ドキュメント

# Rust API ドキュメントを生成して開く
cargo doc --no-deps --open

mdBook ドキュメント

# ドキュメントサイトをビルド
mdbook build docs

# ローカルプレビューサーバーを起動 (http://localhost:3000)
mdbook serve docs

# Markdown ファイルを Lint
markdownlint-cli2 "docs/src/**/*.md"