Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1c3bf19
Enable strict clippy (pedantic + restriction) with documented allow-list
aram356 Apr 25, 2026
91ee677
Factor out API-design clippy allow-list
aram356 Apr 25, 2026
6677778
Audit and re-justify previously papered-over clippy allows
aram356 Apr 25, 2026
476d411
Style-pass: factor out ~50 sites; rewrite allow-list rationale
aram356 Apr 25, 2026
a5df55b
Have #[action] emit `#[allow(clippy::unused_async)]` on the inner fn
aram356 Apr 25, 2026
4c8e2aa
Imports/paths + Attributes track: 6 lints factored out
aram356 Apr 25, 2026
0cbae0f
Documentation pass: factor out missing_panics_doc / missing_errors_do…
aram356 Apr 25, 2026
b86f39f
Output/diagnostics: route CLI through log to remove print_stderr/prin…
aram356 Apr 25, 2026
b1af7b2
Stylistic small-wins: factor out 4 more allow entries with real renames
aram356 Apr 25, 2026
1506738
Propagate response/builder/init errors instead of panicking on the re…
aram356 Apr 26, 2026
f667c62
Add typed GeneratorError + ScaffoldError for the CLI scaffold path
aram356 Apr 26, 2026
193e0c1
Update examples/app-demo handler tests for fallible IntoResponse trait
aram356 Apr 26, 2026
c9dea46
Apply strict-clippy gate to examples/app-demo
aram356 Apr 26, 2026
dcf8a18
Refactor most demo allows into real fixes
aram356 Apr 26, 2026
dcca14a
Refactor more demo allows into real fixes
aram356 Apr 26, 2026
4fbc82d
Reorder demo handlers to canonical layout
aram356 Apr 26, 2026
d9b8484
Generate strict-clippy gate in edgezero new projects
aram356 Apr 26, 2026
d352ac3
Propagate router errors in cloudflare and spin dispatch paths
aram356 Apr 26, 2026
fa76775
Refactor production code so several allows can move from workspace to…
aram356 Apr 26, 2026
e3fa443
Fix str_to_string: replace .to_string() on &str with .to_owned() work…
aram356 Apr 26, 2026
c2b84c8
Fix default_numeric_fallback: add type suffixes to literals
aram356 Apr 26, 2026
2293264
Fix absolute_paths in core crate + axum proxy
aram356 Apr 26, 2026
49c70c5
Major slim-down of allow-list towards demo's profile
aram356 Apr 26, 2026
44b4e86
Remove missing_trait_methods workspace allow
aram356 Apr 26, 2026
48d7348
Trim redundant pub use re-exports from edgezero-core lib root
aram356 Apr 26, 2026
5e9cbf0
Document why format_push_string is load-bearing
aram356 Apr 26, 2026
d8d475b
Remove format_push_string allow; propagate fmt::Error in generator
aram356 Apr 26, 2026
f6bd344
Remove single_char_lifetime_names allow; rename 4 lifetimes
aram356 Apr 26, 2026
cab6413
Remove shadow_reuse allow; rename ~30 shadowed bindings
aram356 Apr 26, 2026
061fb72
Remove tests_outside_test_module allow
aram356 Apr 26, 2026
97b6057
Remove pub_use workspace allow; localize to file-level expects
aram356 Apr 26, 2026
4bd988d
Replace pub_use file-level expects with real pub mod restructure
aram356 Apr 27, 2026
a908521
Remove allow_attributes workspace allow
aram356 Apr 27, 2026
9e49e12
Add workspace-level .cargo/config.toml for wasm32-wasip1 runner
aram356 Apr 27, 2026
a3bfb59
Add CI test job for spin adapter; collapse wasm jobs into a matrix
aram356 Apr 27, 2026
d0749e8
Drop redundant extra_check; explain why axum stays out of the matrix
aram356 Apr 27, 2026
f65b1f5
Guard wasm test runner installs against cached binaries
aram356 Apr 27, 2026
14b92fb
Use --force for cargo install of cached wasm runners
aram356 Apr 27, 2026
90e8943
Tighten pub_with_shorthand surface; document why allow stays
aram356 Apr 27, 2026
e0eb5ff
Remove absolute_paths workspace allow; convert ~110 sites to use imports
aram356 Apr 27, 2026
3329c07
Remove arbitrary_source_item_ordering allow; reorder ~300 sites
aram356 Apr 29, 2026
dc3c581
Remove as_conversions workspace allow; eliminate 8 cast sites
aram356 Apr 29, 2026
0060b1f
Remove arithmetic_side_effects allow; use checked/saturating ops
aram356 Apr 29, 2026
42fb68c
Pin Viceroy to ^0.16 in CI
aram356 Apr 29, 2026
b873bba
Pin viceroy 0.16.4 in .tool-versions
aram356 Apr 29, 2026
5113963
Read Viceroy version from .tool-versions in CI
aram356 Apr 29, 2026
2c6b951
Remove min_ident_chars allow; rename ~190 single-char identifiers
aram356 Apr 29, 2026
91b9bc6
Document why module_name_repetitions stays as workspace allow
aram356 Apr 30, 2026
0a49b32
Document why module_name_repetitions stays as workspace allow
aram356 Apr 30, 2026
c55b648
Remove stray libtest_lint.rlib build artifact, ignore *.rlib
aram356 Apr 30, 2026
b1b0453
Remove float_arithmetic allow; use integer ms in request logger
aram356 Apr 30, 2026
855dda9
Document why exhaustive_enums stays as workspace allow
aram356 Apr 30, 2026
b30f353
Remove missing_inline_in_public_items allow; add #[inline] to ~321 fns
aram356 Apr 30, 2026
2a6c22c
Rename Manifest::secret_store_name → secret_store_binding
aram356 May 1, 2026
4932aee
Bump checkout/setup-node/cache actions v4 → v5 (Node 24 runtime)
aram356 May 3, 2026
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
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Workspace-level cargo config so wasm32-wasip1 tests run from the workspace
# root via `-p <crate>`. Per-package `.cargo/config.toml` files only apply
# when cwd is inside the package directory; this file makes the runners
# discoverable from anywhere in the tree.
#
# Cargo invokes the runner with cwd set to the package's manifest directory
# (e.g. `crates/edgezero-adapter-fastly/`), so the `-C` argument is relative
# to that — `../../examples/...` resolves to the same fastly.toml regardless
# of which adapter package is being tested.
[target.wasm32-wasip1]
runner = "viceroy run -C ../../examples/app-demo/crates/app-demo-adapter-fastly/fastly.toml -- "
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0 # For lastUpdated feature

Expand All @@ -38,7 +38,7 @@ jobs:
fi

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Cache cargo dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
working-directory: docs

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Retrieve Node.js version
id: node-version
Expand All @@ -69,7 +69,7 @@ jobs:
shell: bash

- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
Expand Down
125 changes: 56 additions & 69 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Cache Cargo dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
Expand All @@ -46,12 +46,6 @@ jobs:
- name: Add wasm targets
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown

- name: Setup Viceroy
run: |
if ! command -v viceroy &>/dev/null; then
cargo install viceroy --locked
fi

- name: Fetch dependencies (locked)
run: cargo fetch --locked

Expand All @@ -61,42 +55,56 @@ jobs:
- name: Check feature compilation
run: cargo check --workspace --all-targets --features "fastly cloudflare spin"

- name: Check Spin wasm32 compilation
run: cargo check -p edgezero-adapter-spin --target wasm32-wasip1 --features spin

cloudflare-wasm-tests:
name: cloudflare wasm tests
adapter-wasm-tests:
name: ${{ matrix.adapter }} wasm tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- adapter: cloudflare
target: wasm32-unknown-unknown
runner_env: CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER
runner_value: wasm-bindgen-test-runner
- adapter: fastly
target: wasm32-wasip1
runner_env: CARGO_TARGET_WASM32_WASIP1_RUNNER
runner_value: viceroy run
- adapter: spin
target: wasm32-wasip1
runner_env: CARGO_TARGET_WASM32_WASIP1_RUNNER
runner_value: wasmtime run
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Cache Cargo dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-cloudflare-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ matrix.adapter }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-cloudflare-
${{ runner.os }}-cargo-${{ matrix.adapter }}-

- name: Retrieve Rust version
id: rust-version-cloudflare
id: rust-version
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Set up Rust tool chain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version-cloudflare.outputs.rust-version }}
toolchain: ${{ steps.rust-version.outputs.rust-version }}

- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Add wasm target
run: rustup target add ${{ matrix.target }}

- name: Resolve wasm-bindgen CLI version
if: matrix.adapter == 'cloudflare'
id: wasm-bindgen-version
shell: bash
run: |
Expand All @@ -113,62 +121,41 @@ jobs:
test -n "$version"
echo "version=$version" >> "$GITHUB_OUTPUT"

# `--force` is required because the cargo cache may restore an existing
# `~/.cargo/bin/<binary>` from a prior run, which `cargo install` rejects
# by default. Force-overwriting is safe — `--locked` pins the version.
- name: Install wasm-bindgen test runner
run: cargo install wasm-bindgen-cli --version "${{ steps.wasm-bindgen-version.outputs.version }}" --locked

- name: Fetch dependencies (locked)
run: cargo fetch --locked

- name: Run Cloudflare wasm tests
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner
run: cargo test -p edgezero-adapter-cloudflare --features cloudflare --target wasm32-unknown-unknown --test contract

- name: Check Cloudflare wasm target
run: cargo check -p edgezero-adapter-cloudflare --features cloudflare --target wasm32-unknown-unknown

fastly-wasm-tests:
name: fastly wasm tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-fastly-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-fastly-
if: matrix.adapter == 'cloudflare'
run: cargo install wasm-bindgen-cli --version "${{ steps.wasm-bindgen-version.outputs.version }}" --locked --force

- name: Retrieve Rust version
id: rust-version-fastly
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Resolve Viceroy version
if: matrix.adapter == 'fastly'
id: viceroy-version
shell: bash

- name: Set up Rust tool chain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version-fastly.outputs.rust-version }}

- name: Add wasm targets
run: rustup target add wasm32-wasip1
run: echo "version=$(grep '^viceroy ' .tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT"

- name: Setup Viceroy
run: cargo install viceroy --locked
if: matrix.adapter == 'fastly'
# Version comes from .tool-versions (single source of truth shared with
# local dev). viceroy 0.17 raises MSRV to rustc 1.95; we ship 1.91, so
# the .tool-versions entry pins us to a 0.16.x build.
run: cargo install viceroy --version "${{ steps.viceroy-version.outputs.version }}" --locked --force

- name: Setup Wasmtime
if: matrix.adapter == 'spin'
run: |
if ! command -v wasmtime &>/dev/null; then
curl https://wasmtime.dev/install.sh -sSf | bash
echo "$HOME/.wasmtime/bin" >> "$GITHUB_PATH"
fi

- name: Fetch dependencies (locked)
run: cargo fetch --locked

- name: Run Fastly wasm tests
- name: Run ${{ matrix.adapter }} wasm tests
env:
CARGO_TARGET_WASM32_WASIP1_RUNNER: "viceroy run"
run: cargo test -p edgezero-adapter-fastly --features fastly --target wasm32-wasip1 --test contract
${{ matrix.runner_env }}: ${{ matrix.runner_value }}
run: cargo test -p edgezero-adapter-${{ matrix.adapter }} --features ${{ matrix.adapter }} --target ${{ matrix.target }} --test contract

- name: Check Fastly wasm target
run: cargo check -p edgezero-adapter-fastly --features fastly --target wasm32-wasip1
- name: Check ${{ matrix.adapter }} wasm target
run: cargo check -p edgezero-adapter-${{ matrix.adapter }} --features ${{ matrix.adapter }} --target ${{ matrix.target }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ docs/superpowers/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.rlib
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fasltly v13.0.0
nodejs 24.12.0
rust 1.91.1
viceroy 0.16.4
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,72 @@ validator = { version = "0.20", features = ["derive"] }
walkdir = { version = "2" }
web-time = "1"
worker = { version = "0.8", features = ["http"] }

[workspace.lints.clippy]
# Same strict gate as the demo workspace. Allow-list mirrors the demo's
# slim set; every additional exception lives at the call site as a
# documented `#[allow]` or `#[expect]` rather than a workspace allow.
pedantic = { level = "warn", priority = -1 }
restriction = { level = "deny", priority = -1 }

# Meta — required when enabling `restriction` as a group.
blanket_clippy_restriction_lints = "allow"

# Documentation — private items don't need full docs.
missing_docs_in_private_items = "allow"

# Style / formatting — match idiomatic Rust conventions.
implicit_return = "allow"
question_mark_used = "allow"
single_call_fn = "allow"
separated_literal_suffix = "allow"
# `pub_with_shorthand` wants `pub(in crate)` but rustfmt unconditionally
# rewrites that to `pub(crate)`. Five legitimate cross-file `pub(crate)`
# items remain (dispatch_raw, dispatch_with_store_names, parse_uri,
# parse_client_addr, decompress_body) — they need at least crate visibility,
# and there is no spelling that satisfies both the lint and rustfmt.
pub_with_shorthand = "allow"
# `module_name_repetitions` was attempted: 39 sites in edgezero-core,
# centred on three concrete blockers that surfaced during the rename:
# 1. `proxy::Request`/`proxy::Response` would collide with the
# `http::Request`/`http::Response` already imported by every
# consumer; the only viable alternative names (`OutboundRequest`,
# `Outbound`) are strictly more verbose than `ProxyRequest`.
# 2. `manifest.rs` has 17 `Manifest*` types; consumers in adapters,
# cli, demos, scaffold templates, and the macro-generated app
# code use these names directly. Stripping the prefix would force
# every site to write `use edgezero_core::manifest::Spec as Manifest`
# etc. — pure churn for no readability gain since `manifest::Spec`
# reads worse than `Manifest`.
# 3. The macro `#[app]` emits code that references these names by
# their current spelling; renaming requires regenerating every
# generated app with new types and updating CLAUDE.md examples.
# Net: the lint's intent (Rust ecosystem `module::Type` idiom) is
# real, but it conflicts with our flat re-export surface and several
# names cannot be deprefixed without losing meaning.
module_name_repetitions = "allow"

# `pattern_type_mismatch` and `ref_patterns` are mutually exclusive in modern
# Rust — every `if let Some(x) = &foo` flags the first, every
# `*foo { Variant(ref x) => ... }` flags the second. We pick match-ergonomics.
pattern_type_mismatch = "allow"

# API design — `exhaustive_structs` fires on the unit struct generated by
# `edgezero_core::app!`.
exhaustive_structs = "allow"
# Only one site triggers `exhaustive_enums` workspace-wide: `Body { Once,
# Stream }`. Marking it `#[non_exhaustive]` would force a wildcard arm
# (`_ => unreachable!()`) at every external `match` site — 37 of them
# across the four adapter crates — and a third Body variant would
# silently panic at runtime instead of producing a compile error.
# Body is intentionally a closed enum.
exhaustive_enums = "allow"

# Imports / paths
std_instead_of_alloc = "allow"
std_instead_of_core = "allow"



[workspace.lints.rust]
unsafe_code = "deny"
9 changes: 9 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Clippy configuration. See https://doc.rust-lang.org/clippy/lint_configuration.html
#
# Test code uses `.unwrap()`, `.expect()`, `panic!`, `assert!`, indexing, and
# other "if-this-fails-the-test-fails" idioms by convention. We keep the
# corresponding restriction lints active in production code but exempt tests.
allow-expect-in-tests = true
allow-indexing-slicing-in-tests = true
allow-panic-in-tests = true
allow-unwrap-in-tests = true
3 changes: 3 additions & 0 deletions crates/edgezero-adapter-axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ version = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[lints]
workspace = true

[features]
default = ["axum"]
axum = [
Expand Down
Loading
Loading