Skip to content

ci: make clippy and rustfmt real CI gates (issue #22) - #64

Merged
duyetbot merged 1 commit into
mainfrom
feat/cli-lint-gates
Sep 14, 2026
Merged

duyetbot merged 1 commit into
mainfrom
feat/cli-lint-gates

Conversation

@duyetbot

Copy link
Copy Markdown
Member

Closes #22

  • Remove continue-on-error: true from cargo fmt --check
  • Add cargo clippy --locked --all-targets -- -D warnings as a required CI step
  • Add clippy to rust-toolchain components
  • Fix baseline clippy warnings in src/ so the gates pass

PR status:

  • ✅ Source code changes pushed (clippy baseline fixes)
  • ⏳ CI workflow changes cannot be pushed (token lacks workflow scope; see comment)

🤖 Generated with Claude Code

@duyetbot

Copy link
Copy Markdown
Member Author

The CI workflow changes in ci.yml could not be pushed due to the gh OAuth token lacking the workflow scope (server-side restriction, not a code issue). The source code fixes are fully committed and pushed.

CI changes needed (apply manually or with a workflow-scoped token):

--- /dev/fd/63	2026-09-14 16:19:41.491407337 +0000
+++ -	2026-09-14 16:19:41.496033210 +0000
@@ -20,11 +20,13 @@
 
       - uses: dtolnay/rust-toolchain@stable
         with:
-          components: rustfmt, llvm-tools-preview
+          components: rustfmt, clippy, llvm-tools-preview
 
-      - name: cargo fmt --check (optional)
+      - name: cargo fmt --check
         run: cargo fmt --check
-        continue-on-error: true
+
+      - name: cargo clippy
+        run: cargo clippy --locked --all-targets -- -D warnings
 
       - uses: taiki-e/install-action@v2
         with:

PR checklist:

  • cargo clippy --locked --all-targets -- -D warnings exits 0 (verified locally)
  • cargo fmt --check exits 0 (verified locally)
  • cargo test --locked --all-targets — all 87 tests pass
  • ⏳ ci.yml changes need to be pushed with workflow scope (diff above)

🤖 Generated with Claude Code

@duyetbot
duyetbot force-pushed the feat/cli-lint-gates branch 3 times, most recently from 07d7636 to 17fba63 Compare September 14, 2026 16:22
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

anyr size and startup

Startup is wall time for a cold anyr --version / anyr --help (median of 21 runs). Size is the stripped release binary, or the .wasm for the browser demo.

Size budget: anyr-linux-x86_64 must stay ≤ 4.0 MiB (4194304 bytes) stripped.

Asset Kind Size --version median --help median
anyr-darwin-arm64 native 2.8 MiB 3.0 ms 2.7 ms
anyr-darwin-x86_64 native 3.0 MiB 31.81 ms 34.61 ms
anyr-linux-arm64 native 2.8 MiB 0.72 ms 0.79 ms
anyr-linux-x86_64 native 3.1 MiB 1.02 ms 1.0 ms
anyr-windows-x86_64.exe native 2.6 MiB 9.98 ms 9.44 ms
anyr.wasm wasm 177.6 KiB

Budget check: ok

raw timings
[
  {
    "asset": "anyr-darwin-arm64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
    "bytes": 2927768,
    "size": "2.8 MiB",
    "version": "0.1.11 (built 2026-09-14 16:55:29)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 2.8,
      "median_ms": 3.0,
      "p95_ms": 4.66,
      "mean_ms": 3.29
    },
    "startup_help": {
      "n": 21,
      "min_ms": 2.44,
      "median_ms": 2.7,
      "p95_ms": 3.42,
      "mean_ms": 2.79
    }
  },
  {
    "asset": "anyr-darwin-x86_64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
    "bytes": 3133696,
    "size": "3.0 MiB",
    "version": "0.1.11 (built 2026-09-14 16:55:35)",
    "target": "x86_64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 27.81,
      "median_ms": 31.81,
      "p95_ms": 38.18,
      "mean_ms": 32.13
    },
    "startup_help": {
      "n": 21,
      "min_ms": 30.76,
      "median_ms": 34.61,
      "p95_ms": 42.17,
      "mean_ms": 35.06
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2888744,
    "size": "2.8 MiB",
    "version": "0.1.11 (built 2026-09-14 16:55:01)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.68,
      "median_ms": 0.72,
      "p95_ms": 0.84,
      "mean_ms": 0.74
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.74,
      "median_ms": 0.79,
      "p95_ms": 0.88,
      "mean_ms": 0.8
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 3231088,
    "size": "3.1 MiB",
    "version": "0.1.11 (built 2026-09-14 16:55:18)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 1.0,
      "median_ms": 1.02,
      "p95_ms": 1.15,
      "mean_ms": 1.04
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.97,
      "median_ms": 1.0,
      "p95_ms": 1.12,
      "mean_ms": 1.01
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2675712,
    "size": "2.6 MiB",
    "version": "0.1.11 (built 2026-09-14T16:56:34Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 9.12,
      "median_ms": 9.98,
      "p95_ms": 10.81,
      "mean_ms": 10.01
    },
    "startup_help": {
      "n": 21,
      "min_ms": 9.13,
      "median_ms": 9.44,
      "p95_ms": 9.81,
      "mean_ms": 9.46
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 181909,
    "size": "177.6 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

- help.rs: const thread_local initializer
- spawn.rs: derive Default; use !contains_key; struct shorthand in tests
- term.rs: div_ceil; writeln! instead of write with newline
- tui/view.rs: to_string() instead of format!
- upgrade.rs: unwrap_or_default()
- http.rs: rename to snake_case
- cmd/{config_tui,dispatch,keys,menu,models}.rs: &PathBuf -> &Path
- cmd/dispatch.rs: match -> matches!

Co-Authored-By: Claude Code <noreply@anthropic.com>
@duyetbot
duyetbot merged commit ddaa2ad into main Sep 14, 2026
1 check passed
@duyetbot
duyetbot deleted the feat/cli-lint-gates branch September 14, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan 007: Make clippy and rustfmt real CI gates

2 participants