madoqua 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- madoqua-0.1.0/.claude/settings.json +1 -0
- madoqua-0.1.0/.claude/skills/rust-review/SKILL.md +151 -0
- madoqua-0.1.0/.github/dependabot.yml +38 -0
- madoqua-0.1.0/.github/workflows/audit.yml +29 -0
- madoqua-0.1.0/.github/workflows/cargo-deny.yml +35 -0
- madoqua-0.1.0/.github/workflows/codeql.yml +42 -0
- madoqua-0.1.0/.github/workflows/docs.yml +63 -0
- madoqua-0.1.0/.github/workflows/release.yml +114 -0
- madoqua-0.1.0/.github/workflows/review.yml +89 -0
- madoqua-0.1.0/.gitignore +81 -0
- madoqua-0.1.0/CLAUDE.md +143 -0
- madoqua-0.1.0/Cargo.lock +746 -0
- madoqua-0.1.0/Cargo.toml +82 -0
- madoqua-0.1.0/LICENSE +21 -0
- madoqua-0.1.0/Makefile +92 -0
- madoqua-0.1.0/PKG-INFO +149 -0
- madoqua-0.1.0/README.md +122 -0
- madoqua-0.1.0/clippy.toml +10 -0
- madoqua-0.1.0/deny.toml +27 -0
- madoqua-0.1.0/docs/adr/0001-exit-codes-are-a-contract.md +35 -0
- madoqua-0.1.0/docs/adr/0002-the-seams-the-hook-needs.md +61 -0
- madoqua-0.1.0/docs/adr/0003-timestamps-are-utc-and-dependency-free.md +43 -0
- madoqua-0.1.0/docs/adr/0004-the-guide-is-the-docs.md +92 -0
- madoqua-0.1.0/docs/adr/README.md +18 -0
- madoqua-0.1.0/docs/book.toml +23 -0
- madoqua-0.1.0/docs/custom.css +260 -0
- madoqua-0.1.0/docs/dev/ARCHITECTURE.md +64 -0
- madoqua-0.1.0/docs/gen-version.sh +34 -0
- madoqua-0.1.0/docs/generate-llms-txt.sh +56 -0
- madoqua-0.1.0/docs/inject-shared.sh +100 -0
- madoqua-0.1.0/docs/lint-mermaid.mjs +76 -0
- madoqua-0.1.0/docs/mermaid-init.js +45 -0
- madoqua-0.1.0/docs/mermaid.min.js +2609 -0
- madoqua-0.1.0/docs/package-lock.json +173 -0
- madoqua-0.1.0/docs/package.json +10 -0
- madoqua-0.1.0/docs/plans/PROMPT-rust-hook.md +189 -0
- madoqua-0.1.0/docs/shared/claude-snippet.md +24 -0
- madoqua-0.1.0/docs/src/SUMMARY.md +19 -0
- madoqua-0.1.0/docs/src/commands/guide.md +56 -0
- madoqua-0.1.0/docs/src/commands/install.md +30 -0
- madoqua-0.1.0/docs/src/commands/overview.md +15 -0
- madoqua-0.1.0/docs/src/commands/run.md +64 -0
- madoqua-0.1.0/docs/src/commands/stats.md +82 -0
- madoqua-0.1.0/docs/src/configuration.md +90 -0
- madoqua-0.1.0/docs/src/guide/setup.md +50 -0
- madoqua-0.1.0/docs/src/guide/triage.md +43 -0
- madoqua-0.1.0/docs/src/guide/tune.md +53 -0
- madoqua-0.1.0/docs/src/how-it-works.md +58 -0
- madoqua-0.1.0/docs/src/index.md +36 -0
- madoqua-0.1.0/docs/src/setup.md +77 -0
- madoqua-0.1.0/docs/src/troubleshooting.md +78 -0
- madoqua-0.1.0/docs/theme/head.hbs +3 -0
- madoqua-0.1.0/docs/toolchain.sh +69 -0
- madoqua-0.1.0/docs/version.js +24 -0
- madoqua-0.1.0/prek.toml +38 -0
- madoqua-0.1.0/pyproject.toml +42 -0
- madoqua-0.1.0/release.toml +25 -0
- madoqua-0.1.0/rust-toolchain.toml +3 -0
- madoqua-0.1.0/rustfmt.toml +3 -0
- madoqua-0.1.0/src/cli.rs +337 -0
- madoqua-0.1.0/src/clock.rs +147 -0
- madoqua-0.1.0/src/config.rs +670 -0
- madoqua-0.1.0/src/git.rs +85 -0
- madoqua-0.1.0/src/guide.rs +685 -0
- madoqua-0.1.0/src/hook.rs +280 -0
- madoqua-0.1.0/src/install.rs +45 -0
- madoqua-0.1.0/src/lib.rs +28 -0
- madoqua-0.1.0/src/main.rs +42 -0
- madoqua-0.1.0/src/report.rs +167 -0
- madoqua-0.1.0/src/runner.rs +517 -0
- madoqua-0.1.0/src/stats.rs +250 -0
- madoqua-0.1.0/src/timelog.rs +244 -0
- madoqua-0.1.0/src/venv.rs +284 -0
- madoqua-0.1.0/tests/cli.rs +309 -0
- madoqua-0.1.0/tests/common/mod.rs +198 -0
- madoqua-0.1.0/tests/hook.rs +347 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rust-review
|
|
3
|
+
context: fork
|
|
4
|
+
background: false
|
|
5
|
+
description: Deep Rust code quality review. Auto-invoke when finishing a task, before marking work complete, when the user asks to review code, or when preparing a PR. Covers error handling, duplicated logic, test quality, performance patterns, idiomatic Rust, docs-code alignment, and API design beyond what clippy catches.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Deep Code Review for madoqua
|
|
9
|
+
|
|
10
|
+
Perform a thorough code quality review of the changes in this project. Go beyond
|
|
11
|
+
what clippy and rustfmt catch. Focus on the areas below and report findings
|
|
12
|
+
grouped by severity: 🔴 Must Fix, 🟡 Should Fix, 🟢 Suggestion.
|
|
13
|
+
|
|
14
|
+
First, run `cargo fmt --all -- --check` and
|
|
15
|
+
`cargo clippy --all-targets --all-features -- -D warnings` to confirm the
|
|
16
|
+
automated checks pass. If they don't, report them as findings — do **not** fix
|
|
17
|
+
them yourself. This skill reviews; it does not edit.
|
|
18
|
+
|
|
19
|
+
## Returning results
|
|
20
|
+
|
|
21
|
+
This skill runs in a fork, so its transcript is never shown to the user. The
|
|
22
|
+
complete report must be your **final message** — the full findings text, not a
|
|
23
|
+
summary of it, not a pointer to a file, not "see above". Anything you leave out
|
|
24
|
+
of that last message is lost.
|
|
25
|
+
|
|
26
|
+
Concretely:
|
|
27
|
+
|
|
28
|
+
- Emit every finding in full (severity, location, why, concrete fix) in the
|
|
29
|
+
final message.
|
|
30
|
+
- Do not write findings to a scratch file and reference the path instead.
|
|
31
|
+
- If the review is clean, say so explicitly and state what you checked.
|
|
32
|
+
- Do not end with a question — the caller cannot answer it.
|
|
33
|
+
|
|
34
|
+
## 1. Error Handling Quality
|
|
35
|
+
|
|
36
|
+
- `.unwrap()` / `.expect()` outside tests is denied by lint config. Flag any
|
|
37
|
+
instance that slipped through (macros, build scripts, `#[allow]`s).
|
|
38
|
+
- Check that `.context("message")` is used on every `?` that crosses an I/O,
|
|
39
|
+
parsing or subprocess boundary — bare `?` loses which operation failed.
|
|
40
|
+
- Flag `Result` return types where the function never returns `Err`.
|
|
41
|
+
- Flag `.map_err(|_| ...)` that silently discards error information.
|
|
42
|
+
- The crate is `anyhow`-based end to end. Flag `String` as an error type, and
|
|
43
|
+
flag any place where a caller has to string-match an error message to make a
|
|
44
|
+
decision — that wants a typed error instead.
|
|
45
|
+
|
|
46
|
+
## 2. Process and I/O Seams
|
|
47
|
+
|
|
48
|
+
madoqua's core invariant: every process spawn, filesystem read and environment
|
|
49
|
+
lookup lives in a module that exists to do it, and everything downstream of a
|
|
50
|
+
seam takes already-parsed data.
|
|
51
|
+
|
|
52
|
+
- Flag any new `std::process::Command`, `std::fs` read, or environment lookup
|
|
53
|
+
outside those seams.
|
|
54
|
+
- Flag new inputs threaded directly into a rules module rather than behind the
|
|
55
|
+
trait it reaches the world through — that is what keeps the unit tests
|
|
56
|
+
runnable with nothing installed.
|
|
57
|
+
- Check that command bodies live in `cli.rs`, not `main.rs`.
|
|
58
|
+
- Check that logs go to stderr and output to stdout — a `--json` run must stay
|
|
59
|
+
pipeable with `--verbose` on.
|
|
60
|
+
|
|
61
|
+
## 3. Duplicated Logic
|
|
62
|
+
|
|
63
|
+
- Search for functions or code blocks that do substantially the same thing with
|
|
64
|
+
minor variations. Flag them and suggest extraction into a shared function,
|
|
65
|
+
trait, or generic.
|
|
66
|
+
- Pay special attention to:
|
|
67
|
+
- Path normalization against the project root
|
|
68
|
+
- JSON payload shaping and parsing
|
|
69
|
+
- Error handling boilerplate that could be a helper
|
|
70
|
+
- Similar match arms across different functions
|
|
71
|
+
- Suggest concrete refactoring: which function to extract, what parameters it
|
|
72
|
+
should take.
|
|
73
|
+
|
|
74
|
+
## 4. Test Quality
|
|
75
|
+
|
|
76
|
+
- **Tests that don't assert**: Flag any test that just calls code without
|
|
77
|
+
asserting on the result. Running without panicking is not a test.
|
|
78
|
+
- **Tests that assert too little**: `assert!(result.is_ok())` without checking
|
|
79
|
+
the value inside is weak. Suggest asserting on the actual content.
|
|
80
|
+
- **Overly verbose tests**: Tests with excessive setup that obscure what's
|
|
81
|
+
actually being tested. Suggest extracting test helpers into
|
|
82
|
+
`tests/common/mod.rs`.
|
|
83
|
+
- **Missing edge cases**: For each public function, check if tests cover: empty
|
|
84
|
+
input, error paths, boundary conditions.
|
|
85
|
+
- **Test naming**: Test names should describe the behavior being tested, not the
|
|
86
|
+
implementation (`returns_error_on_missing_file`, not `test_function_xyz`).
|
|
87
|
+
- **Integration vs unit**: unit tests (`#[cfg(test)] mod tests`) test internal
|
|
88
|
+
logic; `tests/*.rs` exercise the public CLI interface.
|
|
89
|
+
- **Exit codes are contract.** `0` clean, `1` findings, `2` could not complete
|
|
90
|
+
(ADR 0001). Flag any new path that could return the wrong one, and any test
|
|
91
|
+
that asserts on stdout without asserting on the exit code.
|
|
92
|
+
- Flag a changed snapshot (`tests/snapshots/*.snap`) whose diff is not explained
|
|
93
|
+
by an intentional behavior change.
|
|
94
|
+
|
|
95
|
+
## 5. Performance Patterns
|
|
96
|
+
|
|
97
|
+
- Flag unnecessary `.clone()` — suggest borrowing or restructuring ownership.
|
|
98
|
+
- Flag `.collect::<Vec<_>>()` immediately followed by `.iter()`.
|
|
99
|
+
- Prefer `&str` over `String`, `&[T]` over `Vec<T>`, `&Path` over `PathBuf` in
|
|
100
|
+
function parameters when ownership isn't needed.
|
|
101
|
+
- Flag large structs passed by value instead of by reference.
|
|
102
|
+
- Flag repeated linear scans over a collection that is looked up by key —
|
|
103
|
+
suggest a `HashMap`/`HashSet`.
|
|
104
|
+
|
|
105
|
+
## 6. Idiomatic Rust
|
|
106
|
+
|
|
107
|
+
- Prefer iterator chains over manual `for` loops with `push`.
|
|
108
|
+
- Use `if let` / `let else` instead of `match` with a single interesting arm and
|
|
109
|
+
a wildcard.
|
|
110
|
+
- Suggest `impl From<X> for Y` instead of standalone conversion functions.
|
|
111
|
+
- Suggest `Display` implementations instead of `to_string()` methods.
|
|
112
|
+
- Flag `&String`, `&Vec<T>`, `&Box<T>` in signatures — use `&str`, `&[T]`, `&T`.
|
|
113
|
+
- Check doc comments on all public types and functions.
|
|
114
|
+
|
|
115
|
+
## 7. Documentation ↔ Code Alignment
|
|
116
|
+
|
|
117
|
+
- **`docs/src/commands/*.md`** must describe the current CLI. Compare documented
|
|
118
|
+
flags, subcommands, exit codes and JSON field names against the `clap`
|
|
119
|
+
definitions in `src/cli.rs` and the serde structs in `src/report.rs`.
|
|
120
|
+
- **`docs/src/how-it-works.md`** must match the actual pipeline — which command
|
|
121
|
+
shells out to what, and in what order.
|
|
122
|
+
- **`docs/dev/ARCHITECTURE.md`** and the **Key Invariants** list in `CLAUDE.md`
|
|
123
|
+
must still be true of the code. An invariant that the code no longer upholds
|
|
124
|
+
is a 🔴 either way: either the code regressed or the doc is lying.
|
|
125
|
+
- **`docs/adr/`**: if the change contradicts a recorded decision, flag it — the
|
|
126
|
+
fix is a new ADR superseding it, not a silent divergence.
|
|
127
|
+
- **Shared prose**: `README.md` and `docs/src/setup.md` are generated between
|
|
128
|
+
`<!-- BEGIN SHARED:... -->` markers. Flag any edit made inside the markers
|
|
129
|
+
instead of in `docs/shared/`.
|
|
130
|
+
- **New page, no `SUMMARY.md` entry**: the page is unreachable and missing from
|
|
131
|
+
`llms.txt`.
|
|
132
|
+
- Flag any mismatch as 🔴 Must Fix — stale docs are worse than no docs.
|
|
133
|
+
|
|
134
|
+
## 8. API and Module Design
|
|
135
|
+
|
|
136
|
+
- Is `main.rs` thin? Argument parsing, tracing setup, exit-code mapping only.
|
|
137
|
+
- Are module boundaries clean? Each module should have a clear responsibility.
|
|
138
|
+
- Check for any `pub` items that don't need to be public.
|
|
139
|
+
- Flag circular dependencies between modules.
|
|
140
|
+
|
|
141
|
+
## Output Format
|
|
142
|
+
|
|
143
|
+
Group all findings by severity, then by area. For each finding:
|
|
144
|
+
|
|
145
|
+
- State **what** the issue is and **where** (`file.rs:line` or function name)
|
|
146
|
+
- Explain **why** it matters
|
|
147
|
+
- Suggest a **concrete fix** (not just "improve this")
|
|
148
|
+
|
|
149
|
+
End with a summary: X must-fix, Y should-fix, Z suggestions.
|
|
150
|
+
|
|
151
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Rust (Cargo) dependencies
|
|
4
|
+
- package-ecosystem: "cargo"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
day: "monday"
|
|
9
|
+
open-pull-requests-limit: 10
|
|
10
|
+
labels:
|
|
11
|
+
- "dependencies"
|
|
12
|
+
- "rust"
|
|
13
|
+
groups:
|
|
14
|
+
minor-and-patch:
|
|
15
|
+
update-types:
|
|
16
|
+
- "minor"
|
|
17
|
+
- "patch"
|
|
18
|
+
|
|
19
|
+
# GitHub Actions
|
|
20
|
+
- package-ecosystem: "github-actions"
|
|
21
|
+
directory: "/"
|
|
22
|
+
schedule:
|
|
23
|
+
interval: "weekly"
|
|
24
|
+
labels:
|
|
25
|
+
- "dependencies"
|
|
26
|
+
- "ci"
|
|
27
|
+
|
|
28
|
+
# Python dependencies declared in pyproject.toml. The wheel is built by
|
|
29
|
+
# maturin, so there is no lockfile at the root to keep in step — weekly is
|
|
30
|
+
# enough.
|
|
31
|
+
- package-ecosystem: "pip"
|
|
32
|
+
directory: "/"
|
|
33
|
+
schedule:
|
|
34
|
+
interval: "weekly"
|
|
35
|
+
open-pull-requests-limit: 10
|
|
36
|
+
labels:
|
|
37
|
+
- "dependencies"
|
|
38
|
+
- "python"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: "Cargo Audit"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths:
|
|
6
|
+
- "Cargo.toml"
|
|
7
|
+
- "Cargo.lock"
|
|
8
|
+
pull_request:
|
|
9
|
+
paths:
|
|
10
|
+
- "Cargo.toml"
|
|
11
|
+
- "Cargo.lock"
|
|
12
|
+
schedule:
|
|
13
|
+
- cron: "0 0 * * *" # Daily at midnight UTC
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
issues: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
audit:
|
|
22
|
+
name: Security Audit
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout repository
|
|
26
|
+
uses: actions/checkout@v7
|
|
27
|
+
|
|
28
|
+
- name: Run cargo-audit
|
|
29
|
+
uses: actions-rust-lang/audit@v1
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: "Cargo Deny"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
paths:
|
|
7
|
+
- "Cargo.lock"
|
|
8
|
+
- "Cargo.toml"
|
|
9
|
+
- "deny.toml"
|
|
10
|
+
pull_request:
|
|
11
|
+
paths:
|
|
12
|
+
- "Cargo.lock"
|
|
13
|
+
- "Cargo.toml"
|
|
14
|
+
- "deny.toml"
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
deny:
|
|
21
|
+
name: ${{ matrix.check }}
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
strategy:
|
|
24
|
+
fail-fast: false
|
|
25
|
+
matrix:
|
|
26
|
+
check: [bans, licenses, sources]
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v7
|
|
30
|
+
|
|
31
|
+
- name: Run cargo-deny (${{ matrix.check }})
|
|
32
|
+
uses: EmbarkStudios/cargo-deny-action@v2
|
|
33
|
+
with:
|
|
34
|
+
command: check ${{ matrix.check }}
|
|
35
|
+
arguments: --all-features
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: "CodeQL"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
paths:
|
|
7
|
+
- "src/**"
|
|
8
|
+
- "Cargo.toml"
|
|
9
|
+
- "Cargo.lock"
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: ["main"]
|
|
12
|
+
paths:
|
|
13
|
+
- "src/**"
|
|
14
|
+
- "Cargo.toml"
|
|
15
|
+
- "Cargo.lock"
|
|
16
|
+
schedule:
|
|
17
|
+
- cron: "0 6 * * 1" # Weekly on Monday at 06:00 UTC
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
security-events: write
|
|
21
|
+
packages: read
|
|
22
|
+
actions: read
|
|
23
|
+
contents: read
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
analyze:
|
|
27
|
+
name: Analyze Rust
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout repository
|
|
31
|
+
uses: actions/checkout@v7
|
|
32
|
+
|
|
33
|
+
- name: Initialize CodeQL
|
|
34
|
+
uses: github/codeql-action/init@v4
|
|
35
|
+
with:
|
|
36
|
+
languages: rust
|
|
37
|
+
build-mode: none
|
|
38
|
+
|
|
39
|
+
- name: Perform CodeQL Analysis
|
|
40
|
+
uses: github/codeql-action/analyze@v4
|
|
41
|
+
with:
|
|
42
|
+
category: "/language:rust"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Deploy docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: ["main"]
|
|
5
|
+
paths:
|
|
6
|
+
- "docs/**"
|
|
7
|
+
- "src/**" # rebuild when CLI changes (help text may change)
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: "pages"
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
deploy:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
environment:
|
|
22
|
+
name: github-pages
|
|
23
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
|
|
27
|
+
- uses: actions/setup-node@v7
|
|
28
|
+
with:
|
|
29
|
+
node-version: "22"
|
|
30
|
+
|
|
31
|
+
- name: Lint mermaid diagrams
|
|
32
|
+
run: |
|
|
33
|
+
cd docs && npm ci --silent
|
|
34
|
+
cd .. && node docs/lint-mermaid.mjs
|
|
35
|
+
|
|
36
|
+
# Versions come from docs/toolchain.sh so CI and `make docs` cannot
|
|
37
|
+
# drift onto an incompatible mdbook/mdbook-mermaid pair.
|
|
38
|
+
- name: Install mdBook and preprocessors
|
|
39
|
+
run: |
|
|
40
|
+
eval "$(bash docs/toolchain.sh --versions)"
|
|
41
|
+
mkdir -p bin
|
|
42
|
+
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=bin
|
|
43
|
+
curl -sSL "https://github.com/badboy/mdbook-mermaid/releases/download/v$MDBOOK_MERMAID_VERSION/mdbook-mermaid-v$MDBOOK_MERMAID_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=bin
|
|
44
|
+
echo "$PWD/bin" >> $GITHUB_PATH
|
|
45
|
+
|
|
46
|
+
- name: Check the docs toolchain matches the pins
|
|
47
|
+
run: bash docs/toolchain.sh
|
|
48
|
+
|
|
49
|
+
- name: Sync docs version badge with Cargo.toml
|
|
50
|
+
run: bash docs/gen-version.sh
|
|
51
|
+
|
|
52
|
+
- name: Build book
|
|
53
|
+
run: mdbook build docs
|
|
54
|
+
|
|
55
|
+
- name: Generate llms.txt
|
|
56
|
+
run: bash docs/generate-llms-txt.sh
|
|
57
|
+
|
|
58
|
+
- uses: actions/upload-pages-artifact@v5
|
|
59
|
+
with:
|
|
60
|
+
path: docs/book/html
|
|
61
|
+
|
|
62
|
+
- uses: actions/deploy-pages@v5
|
|
63
|
+
id: deployment
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-wheels:
|
|
14
|
+
name: Build wheels on ${{ matrix.os }}
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, macos-14, windows-latest]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v7
|
|
22
|
+
|
|
23
|
+
- name: Build wheels
|
|
24
|
+
uses: PyO3/maturin-action@v1
|
|
25
|
+
with:
|
|
26
|
+
args: --release --strip
|
|
27
|
+
manylinux: 2_28
|
|
28
|
+
|
|
29
|
+
- name: Upload wheels
|
|
30
|
+
uses: actions/upload-artifact@v7
|
|
31
|
+
with:
|
|
32
|
+
name: wheels-${{ matrix.os }}
|
|
33
|
+
path: target/wheels/*.whl
|
|
34
|
+
|
|
35
|
+
build-sdist:
|
|
36
|
+
name: Build source distribution
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
|
+
|
|
41
|
+
- name: Set up Rust
|
|
42
|
+
uses: dtolnay/rust-toolchain@stable
|
|
43
|
+
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v7
|
|
46
|
+
with:
|
|
47
|
+
python-version: '3.11'
|
|
48
|
+
|
|
49
|
+
- name: Install maturin
|
|
50
|
+
run: pip install maturin
|
|
51
|
+
|
|
52
|
+
- name: Build sdist
|
|
53
|
+
run: maturin sdist
|
|
54
|
+
|
|
55
|
+
- name: Upload sdist
|
|
56
|
+
uses: actions/upload-artifact@v7
|
|
57
|
+
with:
|
|
58
|
+
name: sdist
|
|
59
|
+
path: target/wheels/*.tar.gz
|
|
60
|
+
|
|
61
|
+
create-release:
|
|
62
|
+
name: Create GitHub Release
|
|
63
|
+
needs: [build-wheels, build-sdist]
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v7
|
|
68
|
+
|
|
69
|
+
- name: Download all artifacts
|
|
70
|
+
uses: actions/download-artifact@v8
|
|
71
|
+
with:
|
|
72
|
+
path: dist
|
|
73
|
+
|
|
74
|
+
- name: Flatten artifacts
|
|
75
|
+
run: |
|
|
76
|
+
mkdir -p wheels
|
|
77
|
+
find dist -name '*.whl' -exec cp {} wheels/ \;
|
|
78
|
+
find dist -name '*.tar.gz' -exec cp {} wheels/ \;
|
|
79
|
+
|
|
80
|
+
- name: Create Release
|
|
81
|
+
uses: softprops/action-gh-release@v3
|
|
82
|
+
with:
|
|
83
|
+
files: wheels/*
|
|
84
|
+
generate_release_notes: true
|
|
85
|
+
draft: false
|
|
86
|
+
prerelease: false
|
|
87
|
+
|
|
88
|
+
publish-to-pypi:
|
|
89
|
+
name: Publish to PyPI
|
|
90
|
+
needs: [build-wheels, build-sdist, create-release]
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
|
93
|
+
environment:
|
|
94
|
+
name: pypi
|
|
95
|
+
url: https://pypi.org/p/madoqua
|
|
96
|
+
permissions:
|
|
97
|
+
id-token: write
|
|
98
|
+
steps:
|
|
99
|
+
- name: Download all artifacts
|
|
100
|
+
uses: actions/download-artifact@v8
|
|
101
|
+
with:
|
|
102
|
+
path: dist
|
|
103
|
+
|
|
104
|
+
- name: Flatten artifacts
|
|
105
|
+
run: |
|
|
106
|
+
mkdir -p wheels
|
|
107
|
+
find dist -name '*.whl' -exec cp {} wheels/ \;
|
|
108
|
+
find dist -name '*.tar.gz' -exec cp {} wheels/ \;
|
|
109
|
+
|
|
110
|
+
- name: Publish to PyPI
|
|
111
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
112
|
+
with:
|
|
113
|
+
packages-dir: wheels/
|
|
114
|
+
skip-existing: true
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- "src/**"
|
|
8
|
+
- "tests/**"
|
|
9
|
+
- "docs/**"
|
|
10
|
+
- "scripts/**"
|
|
11
|
+
- "Makefile"
|
|
12
|
+
- "Cargo.toml"
|
|
13
|
+
- "Cargo.lock"
|
|
14
|
+
- "rust-toolchain.toml"
|
|
15
|
+
- "clippy.toml"
|
|
16
|
+
- "rustfmt.toml"
|
|
17
|
+
pull_request:
|
|
18
|
+
paths:
|
|
19
|
+
- "src/**"
|
|
20
|
+
- "tests/**"
|
|
21
|
+
- "docs/**"
|
|
22
|
+
- "scripts/**"
|
|
23
|
+
- "Makefile"
|
|
24
|
+
- "Cargo.toml"
|
|
25
|
+
- "Cargo.lock"
|
|
26
|
+
- "rust-toolchain.toml"
|
|
27
|
+
- "clippy.toml"
|
|
28
|
+
- "rustfmt.toml"
|
|
29
|
+
|
|
30
|
+
concurrency:
|
|
31
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
32
|
+
cancel-in-progress: true
|
|
33
|
+
|
|
34
|
+
env:
|
|
35
|
+
CARGO_TERM_COLOR: always
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
fmt:
|
|
39
|
+
name: Formatting
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v7
|
|
43
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
44
|
+
with:
|
|
45
|
+
components: rustfmt
|
|
46
|
+
- run: cargo fmt --all --check
|
|
47
|
+
|
|
48
|
+
clippy:
|
|
49
|
+
name: Clippy
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v7
|
|
53
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
54
|
+
with:
|
|
55
|
+
components: clippy
|
|
56
|
+
- uses: Swatinem/rust-cache@v2
|
|
57
|
+
- run: cargo clippy --all-targets --all-features -- -D warnings
|
|
58
|
+
|
|
59
|
+
test:
|
|
60
|
+
name: Tests
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v7
|
|
64
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
65
|
+
- uses: Swatinem/rust-cache@v2
|
|
66
|
+
- run: cargo test --all-features
|
|
67
|
+
|
|
68
|
+
rustdoc:
|
|
69
|
+
name: Rustdoc
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v7
|
|
73
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
74
|
+
- uses: Swatinem/rust-cache@v2
|
|
75
|
+
# Broken intra-doc links silently render as plain text on docs.rs;
|
|
76
|
+
# nothing else in this workflow catches them.
|
|
77
|
+
- run: cargo doc --no-deps --all-features
|
|
78
|
+
env:
|
|
79
|
+
RUSTDOCFLAGS: -D warnings
|
|
80
|
+
|
|
81
|
+
docs:
|
|
82
|
+
name: Docs are in sync
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/checkout@v7
|
|
86
|
+
- name: Version badge matches Cargo.toml
|
|
87
|
+
run: bash docs/gen-version.sh --check
|
|
88
|
+
- name: Shared snippets are injected
|
|
89
|
+
run: bash docs/inject-shared.sh --check
|
madoqua-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Rust
|
|
2
|
+
/target/
|
|
3
|
+
**/*.rs.bk
|
|
4
|
+
|
|
5
|
+
# Python
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
cf/
|
|
30
|
+
# Virtual environments
|
|
31
|
+
.env
|
|
32
|
+
.venv
|
|
33
|
+
env/
|
|
34
|
+
venv/
|
|
35
|
+
ENV/
|
|
36
|
+
env.bak/
|
|
37
|
+
venv.bak/
|
|
38
|
+
|
|
39
|
+
# Claude Code
|
|
40
|
+
.claude/worktrees/
|
|
41
|
+
|
|
42
|
+
# IDE
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
|
45
|
+
*.swp
|
|
46
|
+
*.swo
|
|
47
|
+
*~
|
|
48
|
+
|
|
49
|
+
# OS
|
|
50
|
+
.DS_Store
|
|
51
|
+
.DS_Store?
|
|
52
|
+
._*
|
|
53
|
+
.Spotlight-V100
|
|
54
|
+
.Trashes
|
|
55
|
+
ehthumbs.db
|
|
56
|
+
Thumbs.db
|
|
57
|
+
|
|
58
|
+
# Logs
|
|
59
|
+
*.log
|
|
60
|
+
|
|
61
|
+
# Temporary files
|
|
62
|
+
*.tmp
|
|
63
|
+
*.temp
|
|
64
|
+
.cache/
|
|
65
|
+
|
|
66
|
+
# maturin / PyO3
|
|
67
|
+
*.so
|
|
68
|
+
*.pyd
|
|
69
|
+
.eggs/
|
|
70
|
+
|
|
71
|
+
# Testing
|
|
72
|
+
.pytest_cache/
|
|
73
|
+
.coverage
|
|
74
|
+
htmlcov/
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Fixture package virtualenvs
|
|
78
|
+
tests/fixtures/**/.venv/
|
|
79
|
+
|
|
80
|
+
# mdBook build output (docs/book.toml build-dir)
|
|
81
|
+
docs/book/
|