Skip to content

naa0yama/rotel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boilerplate-Rust

coverage test execution time

Rust プロジェクトのための開発テンプレート

概要

このプロジェクトは、Rust 開発を始めるためのボイラープレートです。Dev Containers に対応しており、VS Code での開発環境が簡単に構築できます。

必要要件

  • Docker
  • Visual Studio Code
  • VS Code Dev Containers 拡張機能

セットアップ

  1. リポジトリをクローン:
git clone <repository-url>
cd boilerplate-rust
  1. VS Codeでプロジェクトを開く:
code .
  1. VS Codeのコマンドパレット(Ctrl+Shift+P / Cmd+Shift+P)から「Dev Containers: Reopen in Container」を選択

使い方

すべてのタスクは mise run <task> で実行します。

基本操作

mise run build            # デバッグビルド
mise run build:release    # リリースビルド
mise run test             # テスト実行
mise run test:watch       # TDD ウォッチモード
mise run test:doc         # ドキュメントテスト

コード品質

mise run fmt              # フォーマット (cargo fmt + dprint)
mise run fmt:check        # フォーマットチェック
mise run clippy           # Lint
mise run clippy:strict    # Lint (warnings をエラー扱い)
mise run ast-grep         # ast-grep カスタムルールチェック

コミット前チェック

mise run pre-commit       # clean:sweep + fmt:check + clippy:strict + ast-grep + lint:gh

プロジェクト構造

.
├── .cargo/                     # Cargo設定
│   └── config.toml
├── .devcontainer/              # Dev Container設定
│   ├── devcontainer.json       # Dev Container設定ファイル
│   ├── initializeCommand.sh    # 初期化コマンド
│   └── postStartCommand.sh     # 起動後コマンド
├── .githooks/                  # Git hooks (mise run 連携)
│   ├── commit-msg              # Conventional Commits 検証
│   ├── pre-commit              # コミット前チェック
│   └── pre-push                # プッシュ前チェック
├── .github/                    # GitHub Actions & 設定
│   ├── actions/                # カスタムアクション
│   ├── gh-sync/                # gh-sync マニフェスト (テンプレートリポジトリからのファイル同期設定)
│   ├── workflows/              # CI/CD ワークフロー
│   ├── labeler.yml
│   ├── project-config.json         # CI/リリース設定 (ビルドターゲット・タイムアウト・apt パッケージ等)
│   └── release.yml
├── .mise/                      # mise タスク定義
│   ├── tasks.toml              # 共通タスク定義 (boilerplate から管理)
│   └── overrides.toml          # プロジェクト固有のタスク上書き
├── .vscode/                    # VS Code設定
│   ├── launch.json             # デバッグ設定
│   └── settings.json           # ワークスペース設定
├── ast-rules/                  # ast-grep プロジェクトルール
├── crates/                     # ワークスペースクレート
│   └── brust/                  # CLI バイナリクレート
│       ├── src/
│       │   ├── main.rs         # アプリケーションのエントリーポイント
│       │   ├── libs.rs         # モジュール定義
│       │   ├── metrics.rs      # OTel メトリクス instruments
│       │   └── libs/
│       │       ├── count.rs    # イテレーションカウンターモジュール
│       │       ├── hello.rs    # Hello モジュール
│       │       └── http.rs     # HTTP クライアント (OTel メトリクス付き)
│       ├── tests/
│       │   └── integration_test.rs  # 統合テスト
│       ├── build.rs            # ビルドスクリプト
│       └── Cargo.toml          # クレート設定
├── docs/                       # ドキュメント
├── .editorconfig               # エディター設定
├── .gitignore                  # Git除外設定
├── .octocov.yml                # カバレッジレポート設定
├── .tagpr                      # タグ&リリース設定
├── Cargo.lock                  # 依存関係のロックファイル
├── Cargo.toml                  # ワークスペース設定と共有依存関係
├── deny.toml                   # cargo-deny 設定
├── Dockerfile                  # Dockerイメージ定義
├── dprint.jsonc                # Dprint フォーマッター設定
├── LICENSE                     # ライセンスファイル
├── mise.toml                   # ツール管理 (タスクは .mise/ を参照)
├── README.md                   # このファイル
├── renovate.json               # Renovate自動依存関係更新設定
├── rust-toolchain.toml         # Rust toolchain バージョン固定
└── sgconfig.yml                # ast-grep 設定ファイル

VSCode拡張機能

このプロジェクトの Dev Containers には、Rust開発を効率化する以下の拡張機能が含まれています:

Rust開発

  • rust-analyzer - Rust言語サポート(コード補完、エラー検出、リファクタリング)
  • CodeLLDB - Rustプログラムのデバッグサポート
  • Even Better TOML - Cargo.tomlファイルのシンタックスハイライトとバリデーション

コード品質・フォーマット

  • Biome - 高速なフォーマッターとリンター
  • dprint - 高速なコードフォーマッター(設定ファイル: dprint.jsonc
  • EditorConfig for VS Code - エディター設定の統一
  • Error Lens - エラーと警告をインラインで表示

開発支援

テキスト編集

ライセンス

このプロジェクトは LICENSE ファイルに記載されているライセンスの下で公開されています。

サードパーティライセンスについて

Dev Container の起動時に OpenObserve Enterprise Edition が自動的にダウンロード・インストールされます。Enterprise 版は MCP (Model Context Protocol) サーバー機能など OSS 版にはない付加機能を備えているため採用しています。Enterprise 版は 200GB/Day のインジェストクォータ内であれば無料で利用できます。

OpenObserve Enterprise Edition は EULA (End User License Agreement) の下で提供されており、OSS 版 (AGPL-3.0) とはライセンスが異なります。Enterprise 版の機能一覧は OpenObserve Enterprise を参照してください。

参考資料

Troubleshooting

Rust debug

RUST_LOG=trace RUST_BACKTRACE=1 cargo run -- help

About

Network observability agent — converts raw network protocols to OpenTelemetry signals

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Generated from naa0yama/boilerplate-rust