Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,51 @@ overflow-checks = true
[workspace.metadata.fmt]
check_command = "cargo fmt --all -- --check"
format_command = "cargo fmt --all"

# ── Workspace-level lint configuration (#1199) ────────────────────────────────
# Selected clippy::pedantic lints enabled across all 19 contracts.
# See clippy.toml for the full rationale on lints that were SKIPPED.
#
# Each crate that inherits this workspace lint table via `[lints] workspace = true`
# will have these lints active. Individual allow-attributes with a comment
# justification are used at the call site when a lint fires on intentional code.
[workspace.lints.clippy]
# Correctness / subtle bugs
bool_to_int_with_if = "warn" # prefer `usize::from(cond)` over `if cond { 1 } else { 0 }`
cloned_instead_of_copied = "warn" # prefer `.copied()` for Copy types
default_trait_access = "warn" # prefer `Default::default()` over `SomeType::default()`
explicit_iter_loop = "warn" # prefer `for x in iter` over `for x in iter.into_iter()`
filter_map_next = "warn" # prefer `.find_map()` over `.filter_map().next()`
flat_map_option = "warn" # prefer `.filter_map()` over `.flat_map(|x| Some(x)...)`
if_not_else = "warn" # prefer positive conditions first
inconsistent_struct_constructor = "warn" # field order must match struct definition
inefficient_to_string = "warn" # avoid redundant `.to_string()` on already-owned strings
items_after_statements = "warn" # keep item definitions at the top of blocks
manual_assert = "warn" # prefer `assert!()` over `if cond { panic!(...) }`
manual_let_else = "warn" # prefer `let … else` over `match` with early return
manual_ok_or = "warn" # prefer `.ok_or()` over `match … { Some(v) => Ok(v), None => Err(e) }`
map_unwrap_or = "warn" # prefer `.unwrap_or_else()` over `.map().unwrap_or()`
match_bool = "warn" # prefer `if/else` over `match` on booleans
match_same_arms = "warn" # merge identical match arms
needless_continue = "warn" # remove redundant `continue` at end of loop
needless_pass_by_value = "warn" # prefer pass-by-reference when ownership is not needed
range_minus_one = "warn" # prefer `..end` over `..=end - 1`
range_plus_one = "warn" # prefer `..=end` over `..end + 1`
redundant_closure_for_method_calls = "warn" # prefer method references over wrapping closures
return_self_not_must_use = "warn" # builder-pattern methods should be `#[must_use]`
same_functions_in_if_blocks = "warn" # identical function calls in if/else branches
semicolon_if_nothing_returned = "warn" # add trailing `;` to expression statements
unnested_or_patterns = "warn" # prefer `A | B` over nested `match`
unused_self = "warn" # methods that don't use `self` should be free functions
used_underscore_binding = "warn" # using a `_`-prefixed variable suggests it's intentionally unused

# Lints kept at allow (would require large churn or are inapplicable):
# missing_errors_doc, missing_panics_doc — see clippy.toml rationale
# module_name_repetitions — ABI-breaking rename for TokenContract, etc.
# must_use_candidate — too noisy on entry-point fns
# wildcard_imports — soroban_sdk glob imports are idiomatic
# too_many_lines — contract fns are intentionally verbose
# struct_excessive_bools — on-chain state structs need bool fields
# cast_possible_truncation — required for SDK TTL/timestamp APIs
# cast_sign_loss — same as above
# cast_precision_loss — no float arithmetic in contracts
4 changes: 1 addition & 3 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@
"xml2js": "^0.6.2"
},
"devDependencies": {
"@eslint/js": "^8.56.0",
"@faker-js/faker": "^8.4.1",
"@nestjs/apollo": "^10.0.0",
"@nestjs/cli": "^12.0.7",
"@nestjs/cli": "^10.0.0",
"@nestjs/testing": "^10.4.22",
"@pact-foundation/pact": "^16.3.0",
"@testcontainers/postgresql": "^12.1.0",
Expand Down
11 changes: 8 additions & 3 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Brain-Storm Clippy configuration
# Run: cargo clippy --workspace -- -D warnings
#
# Pedantic lint selection (#1199):
# The selected clippy::pedantic lints are declared in [workspace.lints.clippy]
# in the root Cargo.toml and inherited by every contract crate via
# `[lints] workspace = true`. See Cargo.toml for the full annotated list and
# the rationale for lints that were intentionally skipped.

# Disallow integer arithmetic that doesn't use checked/saturating/wrapping variants
# (enforced manually; use checked_add, checked_sub, etc.)

# Minimum Supported Rust Version — keeps lint suggestions compatible with the
# toolchain declared in rust-toolchain.toml.
msrv = "1.70.0"
3 changes: 3 additions & 0 deletions contracts/analytics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ brain-storm-shared = { path = "../shared", default-features = false }
[dev-dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }
proptest = "1.4"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/badges/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ opt-level = "z"
lto = true
codegen-units = 1
strip = true

[lints]
workspace = true
4 changes: 3 additions & 1 deletion contracts/buyback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ crate-type = ["cdylib", "rlib"]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
strip = true
[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/certificate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ brain-storm-shared = { path = "../shared", default-features = false }
[dev-dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }
proptest = "1.4"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/credential_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ crate-type = ["cdylib", "rlib"]
[profile.release]
opt-level = "z"
lto = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/dispute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ opt-level = "z"
lto = true
codegen-units = 1
strip = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/governance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ brain-storm-shared = { path = "../shared", default-features = false }

[dev-dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/grants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ opt-level = "z"
lto = true
codegen-units = 1
strip = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ soroban-sdk = { version = "21.0.0", features = ["testutils"] }
brain-storm-analytics = { path = "../analytics" }
brain-storm-token = { path = "../token" }
brain-storm-shared = { path = "../shared" }

[lints]
workspace = true
4 changes: 3 additions & 1 deletion contracts/liquidity_pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ crate-type = ["cdylib", "rlib"]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
strip = true
[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/market/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ testutils = ["soroban-sdk/testutils"]

[dev-dependencies]
soroban-sdk = { version = "20.0.0", features = ["testutils"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/nft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ opt-level = "z"
lto = true
codegen-units = 1
strip = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ opt-level = "z"
lto = true
codegen-units = 1
strip = true

[lints]
workspace = true
4 changes: 3 additions & 1 deletion contracts/reputation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ crate-type = ["cdylib", "rlib"]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
strip = true
[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/royalty_distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ crate-type = ["cdylib", "rlib"]
[profile.release]
opt-level = "z"
lto = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/scholarship_fund/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ crate-type = ["cdylib", "rlib"]
[profile.release]
opt-level = "z"
lto = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ crate-type = ["cdylib", "rlib"]

[features]
testutils = ["soroban-sdk/testutils"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ testutils = ["soroban-sdk/testutils"]

[dev-dependencies]
soroban-sdk = { version = "20.0.0", features = ["testutils"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions contracts/token_restrictions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ crate-type = ["cdylib", "rlib"]
[profile.release]
opt-level = "z"
lto = true

[lints]
workspace = true
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Entry point for `docs/`. Start here, then follow the links below by topic.

[analytics-guide.md](./analytics-guide.md) · [ANALYTICS.md](./ANALYTICS.md) · [community-moderation.md](./community-moderation.md) · [notifications-guide.md](./notifications-guide.md) · [i18n-guide.md](./i18n-guide.md) · [shared-types.md](./shared-types.md) · [dependency-injection-guide.md](./dependency-injection-guide.md) · [dependency-injection-best-practices.md](./dependency-injection-best-practices.md) · [utilities-guide.md](./utilities-guide.md) · [user-rate-limiting.md](./user-rate-limiting.md) · [ASSET_SUPPORT.md](./ASSET_SUPPORT.md) · [scripts.md](./scripts.md)

## Historical Artifacts

Implementation summaries and PR description drafts from earlier development phases have been moved out of the repository root and consolidated here for posterity:

**[history/](./history/README.md)** — `IMPLEMENTATION_SUMMARY*.md` and `PR_DESC*.md` files (issues #626–#841). These are no longer actively referenced; see merged PRs in GitHub for full context.

---

New to the repo? Read [development-setup.md](./development-setup.md) first, then [architecture.md](./architecture.md), then [adr/README.md](./adr/README.md) for the reasoning behind the current structure.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions docs/history/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Historical Implementation Summaries & PR Descriptions

This directory holds implementation summaries and PR description drafts that are historical artifacts from earlier development phases. They are preserved here for reference but are no longer actively maintained.

| File | Description |
|------|-------------|
| [IMPLEMENTATION_SUMMARY.md](./IMPLEMENTATION_SUMMARY.md) | General implementation summary |
| [IMPLEMENTATION_SUMMARY_626-629.md](./IMPLEMENTATION_SUMMARY_626-629.md) | Implementation summary for issues #626–#629 |
| [IMPLEMENTATION_SUMMARY_834_837.md](./IMPLEMENTATION_SUMMARY_834_837.md) | Implementation summary for issues #834–#837 |
| [IMPLEMENTATION_SUMMARY_838-841.md](./IMPLEMENTATION_SUMMARY_838-841.md) | Implementation summary for issues #838–#841 |
| [PR_DESCRIPTION.md](./PR_DESCRIPTION.md) | Generic PR description template/draft |
| [PR_DESC_COMPLETE.md](./PR_DESC_COMPLETE.md) | PR description — complete feature set |
| [PR_DESC_INFRASTRUCTURE.md](./PR_DESC_INFRASTRUCTURE.md) | PR description — infrastructure changes |
| [PR_DESC_USERS_REPO.md](./PR_DESC_USERS_REPO.md) | PR description — users repository pattern |
| [PR_DESCRIPTION_REPOSITORY_PATTERN.md](./PR_DESCRIPTION_REPOSITORY_PATTERN.md) | PR description — repository pattern migration |

These files were moved from the repository root to `docs/history/` as part of issue #1198.
1 change: 0 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.1.4",
"typescript": "^5.4.0"
Expand Down
Loading