Commit c4b4a0a
authored
211 (#321)
* #211 feat: add real-world examples directory with 4 comprehensive examples
Created examples/ directory with real-world service examples demonstrating
masterror integration with popular frameworks:
- axum-rest-api: Full REST API with RFC 7807 Problem Details, domain errors,
metadata attachment, and 11 integration tests
- sqlx-database: Database error handling patterns including connection errors,
constraint violations, and transactions
- custom-domain-errors: Payment processing domain with derive macro usage,
showcasing authentication, validation, and external service errors
- basic-async: Async error handling with tokio, timeout conversion, and
error propagation patterns
All examples include:
- Comprehensive README.md documentation
- Runnable source code with cargo run
- Integration tests where applicable
- SPDX license headers
- publish = false in Cargo.toml
Updated:
- examples/README.md: Index of all examples with running instructions
- README.template.md: Added Examples section with table
- README.md: Regenerated from template
- Cargo.toml: Added 4 examples as workspace members
Closes #211
* #211 fix: add Unicode-3.0 to allowed licenses for ICU dependencies
* #211 chore: add cargo deny to pre-commit hook and install script
Added cargo deny check to pre-commit hook to catch license issues locally
before CI. This prevents CI failures like the Unicode-3.0 license issue.
Changes:
- Added cargo deny check (advisories, bans, licenses, sources) to pre-commit
- Created .github/scripts/pre-commit (version-controlled hook)
- Created .github/scripts/install-hooks.sh (automated installation)
- Updated deny.toml to allow OSI-approved licenses:
- Unicode-3.0 (ICU dependencies)
- BSD-3-Clause (encoding_rs, matchit)
- Zlib (foldhash)
Pre-commit now runs all CI checks locally:
- rustfmt (nightly)
- REUSE compliance
- clippy (all features, all targets)
- tests (all features)
- cargo audit
- cargo deny (NEW) - catches license issues before CI
- README.md generation
This significantly reduces CI failures by catching issues locally.1 parent 0e416e3 commit c4b4a0a
File tree
22 files changed
+2279
-4
lines changed- .github/scripts
- examples
- axum-rest-api
- src
- tests
- basic-async
- src
- custom-domain-errors
- src
- sqlx-database
- src
22 files changed
+2279
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
0 commit comments