Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BasedOnStyle: LLVM
ColumnLimit: 100
IndentWidth: 2
ReflowComments: true
SortIncludes: true

21 changes: 21 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Minimal clang-tidy config for development - focuses on real bugs
Checks: >
-*,
bugprone-*,
clang-analyzer-*,
misc-unused-*,
modernize-use-nullptr,
modernize-use-override,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-move-const-arg,
performance-unnecessary-copy-initialization,
readability-misleading-indentation,
readability-redundant-*,
-bugprone-easily-swappable-parameters

WarningsAsErrors: ""
HeaderFilterRegex: "native/cpp/.*"
FormatStyle: file

40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "sdk-template",
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"installTools": false
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "latest",
"profile": "default"
},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/copilot-cli:1": {},
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": "cmake,ninja-build,clang,clang-format,clang-tidy"
}
},
"containerEnv": {
"UV_CACHE_DIR": "/tmp/uv-cache"
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"rust-lang.rust-analyzer",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"xaver.clang-format",
"tamasfe.even-better-toml",
"github.vscode-github-actions"
]
}
}
}
29 changes: 29 additions & 0 deletions .devcontainer/scripts/clean-workspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/../.."

echo "==> Cleaning workspace caches..."

# Python caches
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name ".coverage" -delete 2>/dev/null || true
find . -type f -name "coverage.xml" -delete 2>/dev/null || true
find . -type f -name "coverage.info" -delete 2>/dev/null || true
rm -rf htmlcov/ 2>/dev/null || true
rm -rf .hypothesis/ 2>/dev/null || true

# Rust caches
rm -rf native/rust/target/ 2>/dev/null || true

# C++ build artifacts
rm -rf build/ 2>/dev/null || true

# UV cache
rm -rf .venv/ 2>/dev/null || true

echo "==> Workspace cleaned!"
25 changes: 25 additions & 0 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

echo "==> Setting up development environment..."

# Install uv if not already installed
if ! command -v uv &> /dev/null; then
echo "Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.cargo/bin:$PATH"
fi

# Install Rust coverage tool
cargo install cargo-llvm-cov --quiet
rustup component add llvm-tools-preview

# Install Python dependencies
uv sync --dev

# Configure C++ build
cmake -S native/cpp -B build/native-cpp -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

echo "==> Setup complete!"
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.toml]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug report
about: Report a reproducible problem
labels: bug
---

## What happened?

## What did you expect to happen?

## Steps to reproduce

1.
2.
3.

## Environment

- OS:
- Version:

13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature request
about: Suggest an idea or enhancement
labels: enhancement
---

## Problem

What problem are you trying to solve?

## Proposal

What would you like to see added/changed?
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Summary

- What does this change and why? Link issue/ADR when possible.
- If breaking, include migration steps.

## Change Type

- [ ] Feature
- [ ] Bug fix
- [ ] Docs/Chore/Build
- [ ] Performance
- [ ] Breaking change (summarize migration above)

## Impacted Surface

- SDK/API: list new/changed/removed methods, params, responses.
- CLI: commands touched, expected output/exit code changes, help/error text updates.

## Testing

- [ ] Added/updated tests
- [ ] `pre-commit run --all-files`
- [ ] Python: `pytest`
- [ ] Rust: `cargo test --manifest-path native/rust/Cargo.toml` (if touched)
- [ ] C++: `ctest` (if touched)
- [ ] Manual CLI check(s): key command + output

## Documentation

- [ ] README/docs/examples updated
- [ ] CHANGELOG entry under Unreleased for user-facing change
- [ ] SDK docs/API reference updated if surface changed
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches: ["main"]
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install C++ tools
run: |
sudo apt-get update
sudo apt-get install -y clang-format cppcheck

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Install pre-commit
run: python -m pip install --upgrade pip pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure

native-rust:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Clippy
run: cargo clippy --manifest-path native/rust/Cargo.toml --all-targets -- -D warnings

- name: Test
run: cargo test --manifest-path native/rust/Cargo.toml --all-targets

native-cpp:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build

- name: Configure
run: cmake -S native/cpp -B build/native-cpp -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Build
run: cmake --build build/native-cpp

- name: Test
run: ctest --test-dir build/native-cpp --output-on-failure

python:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: uv pip install --system -e ".[dev]" pytest-cov

- name: Test with coverage
run: pytest --cov=cli_template --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false
Loading
Loading