diff --git a/.cline/rules/00-rust-api-guidelines.md b/.cline/rules/00-rust-api-guidelines.md index 4176a9a..314aa39 100644 --- a/.cline/rules/00-rust-api-guidelines.md +++ b/.cline/rules/00-rust-api-guidelines.md @@ -1,7 +1,7 @@ # Rust API Guidelines for Cline Purpose: keep Rust public APIs idiomatic, predictable, interoperable, and stable. -Source basis: https://rust-lang.github.io/api-guidelines/ +Source basis: Use this file as a compact rule set for code generation and review. Prefer these rules for public crate APIs, library boundaries, exported traits, exported structs, public modules, and public error types. For private implementation code, follow the same style unless it hurts clarity. diff --git a/.cline/rules/01-git-workflow.md b/.cline/rules/01-git-workflow.md new file mode 100644 index 0000000..8e4cc5e --- /dev/null +++ b/.cline/rules/01-git-workflow.md @@ -0,0 +1,55 @@ +# Git Workflow for Cline + +Purpose: enforce a consistent Rust-style PR workflow for all changes. Every change must go through a feature branch, a conventional commit, and a pull request. + +## Rules (MUST) + +1. **Always create a new branch** before committing. + - Branch names must be kebab-case: `add-docs-ci-job`, `fix-blob-encrypt-panic`, `ci-pin-actions`. + - Use a descriptive, short name that reflects the change. + +2. **Commit messages must follow conventional commits** with a Rust-style prefix: + - `feat:` – new feature + - `fix:` – bug fix + - `docs:` – documentation only + - `ci:` – CI/CD changes + - `chore:` – maintenance, deps, tooling + - `refactor:` – code change that neither fixes a bug nor adds a feature + - `style:` – formatting, whitespace (no code change) + - `test:` – adding or updating tests + - `perf:` – performance improvement + - `build:` – build system or external dependencies + - `revert:` – revert a previous commit + +3. **Push the branch** to `origin`. + +4. **Create a pull request** via `gh pr create`: + - Use the commit message as the PR title. + - Fill the PR body with a summary of changes. + - Use `--base main`. + - Reference related issues if applicable. + +## Example workflow + +```bash +# 1. Create branch +git checkout -b add-docs-ci-job + +# 2. Stage and commit +git add .github/workflows/ci.yml +git commit -m "ci: add docs job to CI workflow" + +# 3. Push +git push -u origin add-docs-ci-job + +# 4. Create PR +gh pr create \ + --base main \ + --title "ci: add docs job to CI workflow" \ + --body "Build rustdoc for xtax-encryption, xtax-blob-storage, and xtax with --all-features --no-deps, treating warnings as errors." +``` + +## Reference + +- Conventional commits: +- Rust commit style often matches conventional commits with lowercase, no trailing punctuation. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8081d3..c08de9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,4 +107,35 @@ jobs: run: cargo test -p xtax-blob-storage ${{ matrix.features }} - name: Clippy - run: cargo clippy -p xtax-blob-storage ${{ matrix.features }} -- -D warnings \ No newline at end of file + run: cargo clippy -p xtax-blob-storage ${{ matrix.features }} -- -D warnings + + # Documentation build + docs: + name: Documentation build + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: "-D warnings" + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable + + - name: Cache cargo registry + uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6 + with: + path: | + ~/.cargo/registry/ + ~/.cargo/git/ + target/ + key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-docs- + + - name: Build docs xtax-encryption + run: cargo doc -p xtax-encryption --all-features --no-deps + + - name: Build docs xtax-blob-storage + run: cargo doc -p xtax-blob-storage --all-features --no-deps + + - name: Build docs xtax + run: cargo doc -p xtax --all-features --no-deps \ No newline at end of file diff --git a/crates/xtax-blob-storage/src/builder/strategies.rs b/crates/xtax-blob-storage/src/builder/strategies.rs index e876912..a33a5de 100644 --- a/crates/xtax-blob-storage/src/builder/strategies.rs +++ b/crates/xtax-blob-storage/src/builder/strategies.rs @@ -298,7 +298,7 @@ impl BackgroundStrategy for OnStart { /// Strategy that runs the task immediately, then repeats periodically. /// -/// The inner [`Duration`] must be **non-zero**. Passing `Duration::ZERO` causes +/// The inner [`std::time::Duration`] must be **non-zero**. Passing `Duration::ZERO` causes /// `build()` to return an `Err(InvalidInput(...))`. /// /// # Example