Skip to content

Conversation

@LinZhihao-723
Copy link
Member

@LinZhihao-723 LinZhihao-723 commented Oct 22, 2025

  • Rename internal rust-workspace-{fmt,clippy} tasks to cargo-workspace-{fmt,clippy}.
  • Rename RUST_{FMT,CLIPPY} parameters to CARGO_{FMT,CLIPPY}.
  • Reorder task attributes to align with the guideline.
  • Only include the toolchain task file when used.

Description

  • As the title and description (multiline) suggest.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Ensure all workflows pass.
  • Ensure lint:fix-rust and lint:check-rust both worked locally.

Summary by CodeRabbit

  • Chores

    • Removed the global toolchain include; toolchain references are now included locally where needed.
    • Updated task wiring to reference toolchain entries using workspace-style paths.
  • New Features

    • Added workspace-wide formatting and linting tasks to replace prior rust-specific tasks.
    • Standardized flag/variable names for formatting and linting (RUST* → CARGO_*).
    • Test task now runs full workspace tests with all features in release mode.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

Removed top-level toolchains include; added toolchains includes to lint and tests taskfiles; replaced rust-workspace-* tasks with cargo-workspace-*; renamed lint flags from RUST_* to CARGO_*; updated task deps and cargo commands to use cargo +nightly and tests to run with --release --all-features.

Changes

Cohort / File(s) Summary
Top-level taskfile config
taskfile.yaml
Removed the includes entry that referenced taskfiles/toolchains.yaml.
Lint taskfile and new cargo tasks
taskfiles/lint.yaml
Added ./toolchains.yaml include; added cargo-workspace-fmt and cargo-workspace-clippy tasks replacing rust-workspace-*; changed deps to include toolchains:rust and rust-lint-configs as applicable; renamed RUSTFMT_FLAGSCARGO_FMT_FLAGS and RUST_CLIPPY_FLAGSCARGO_CLIPPY_FLAGS; updated commands to use cargo +nightly fmt/clippy with the new flags.
Tests taskfile adjustments
taskfiles/tests/main.yaml
Added ../toolchains.yaml include; changed dependency :toolchains:rusttoolchains:rust; test task command updated to cargo test --all --all-features --release.
Public task & variable references
taskfiles/lint.yaml, taskfiles/tests/main.yaml
Updated public task references: check-rust-format/fix-rust-formatcargo-workspace-fmt; check-rust-static/fix-rust-staticcargo-workspace-clippy; updated related variable names to CARGO_*.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant TaskRunner as Task runner
  participant CargoFmt as cargo-workspace-fmt
  participant CargoClippy as cargo-workspace-clippy
  participant Toolchains as toolchains:rust

  Note over TaskRunner,CargoFmt: Formatting flow (lint.yaml)
  User->>TaskRunner: run check-rust-format / fix-rust-format
  TaskRunner->>CargoFmt: invoke cargo-workspace-fmt (requires CARGO_FMT_FLAGS)
  CargoFmt->>Toolchains: ensure toolchain (toolchains:rust, rust-lint-configs)
  CargoFmt->>CargoFmt: run `cargo +nightly fmt --all -- {{.CARGO_FMT_FLAGS}}`
  CargoFmt-->>TaskRunner: exit status
  TaskRunner-->>User: report result

  Note over TaskRunner,CargoClippy: Linting flow (lint.yaml)
  User->>TaskRunner: run check-rust-static / fix-rust-static
  TaskRunner->>CargoClippy: invoke cargo-workspace-clippy (requires CARGO_CLIPPY_FLAGS)
  CargoClippy->>Toolchains: ensure toolchain (toolchains:rust)
  CargoClippy->>CargoClippy: run `cargo +nightly clippy --all-targets --all-features {{.CARGO_CLIPPY_FLAGS}}`
  CargoClippy-->>TaskRunner: exit status
  TaskRunner-->>User: report result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Reviewers should inspect taskfiles/lint.yaml for correct variable renames and dependency entries, and taskfiles/tests/main.yaml for changed include and test command semantics.

Possibly related issues

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "refactor(taskfile): Refactor Rust lint tasks (fixes #1451)" clearly and directly reflects the primary changes in the changeset. The main modifications involve renaming internal lint tasks from rust-workspace-fmt/clippy to cargo-workspace-fmt/clippy, renaming associated parameters, and optimizing when toolchain files are included. The title specifically identifies "Refactor Rust lint tasks" as the core change, which accurately summarizes the overall objective. The title is concise, uses clear language, and employs proper conventional commits format, making it easy for team members reviewing history to understand the purpose of the changeset.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f432e1e and 87c722b.

📒 Files selected for processing (1)
  • taskfile.yaml (0 hunks)
💤 Files with no reviewable changes (1)
  • taskfile.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: musllinux_1_2-x86_64-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-static-linked-bins
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: rust-checks (ubuntu-22.04)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: rust-checks (ubuntu-24.04)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build (macos-15)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LinZhihao-723 LinZhihao-723 marked this pull request as ready for review October 22, 2025 21:40
@LinZhihao-723 LinZhihao-723 requested a review from a team as a code owner October 22, 2025 21:40
@LinZhihao-723 LinZhihao-723 changed the title refactor(taskfile): Refactor Rust lint tasks: refactor(taskfile): Refactor Rust lint tasks (fixes #1451): Oct 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b059fa0 and 47c4924.

📒 Files selected for processing (2)
  • taskfile.yaml (0 hunks)
  • taskfiles/lint.yaml (3 hunks)
💤 Files with no reviewable changes (1)
  • taskfile.yaml
🔇 Additional comments (4)
taskfiles/lint.yaml (4)

802-802: Rename looks good; flags variable updated.

Swapping to cargo-workspace-fmt and CARGO_FMT_FLAGS aligns with the refactor. No issues spotted in this call site.

Also applies to: 804-804


814-814: Clippy warnings gating is correct.

-- -D warnings is passed through properly. Consider adding --workspace (see below) to ensure full coverage.

Also applies to: 816-816


820-820: Fix task flags are cargo‑side; OK.

--fix --allow-dirty --allow-staged are correctly on the cargo side; no clippy args required.

Also applies to: 822-822


800-823: No remnants of old task names or vars; wrapper aliases are not needed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
taskfiles/tests/main.yaml (1)

12-13: Guard sourcing $HOME/.cargo/env and verify --release usage
Use a file check to avoid failing when the env file is missing, and confirm that running tests with --release (which disables debug assertions) is intentional.

-      . "$HOME/.cargo/env"
+      [ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47c4924 and 6b17825.

📒 Files selected for processing (1)
  • taskfiles/tests/main.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: musllinux_1_2-x86_64-dynamic-linked-bins
  • GitHub Check: package-image
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: musllinux_1_2-x86_64-static-linked-bins
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-dynamic-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: rust-checks (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: lint-check (macos-15)
🔇 Additional comments (1)
taskfiles/tests/main.yaml (1)

5-5: Verify include path and rust task definition

Confirm that the toolchains: "../toolchains.yaml" entry in taskfiles/tests/main.yaml correctly resolves to taskfiles/toolchains.yaml and that this file defines a rust task.

tasks:
rust-all:
deps: [":toolchains:rust"]
deps: ["toolchains:rust"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Good fix on namespaced dep; consider object form for clarity.

String form works; object form reads better and avoids quoting/linters nitpicks.

-    deps: ["toolchains:rust"]
+    deps:
+      - task: toolchains:rust
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
deps: ["toolchains:rust"]
deps:
- task: toolchains:rust
🤖 Prompt for AI Agents
In taskfiles/tests/main.yaml around line 9, the dependency is declared as a
namespaced string deps: ["toolchains:rust"]; change it to the object form (e.g.,
deps: [{ name: "toolchains", tool: "rust" }] or whatever project convention
requires) to improve readability and avoid quoting/linter issues; update the
YAML to use the agreed object keys for namespaced deps and run the linter to
confirm formatting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems a target directory is generated at the project root for build cache. shall we add the directory to .gitignore or set CARGO_TARGET_DIR to somewhere within build/?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can set it under build

Copy link
Contributor

@Bill-hbrhbr Bill-hbrhbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing major

version: "3"

includes:
toolchains: "./toolchains.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
toolchains: "./toolchains.yaml"
toolchains: "toolchains.yaml"

Comment on lines 842 to +843
. "$HOME/.cargo/env"
cargo +nightly fmt --all -- {{.RUSTFMT_FLAGS}}
cargo +nightly fmt --all -- {{.CARGO_FMT_FLAGS}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. "$HOME/.cargo/env"
cargo +nightly fmt --all -- {{.RUSTFMT_FLAGS}}
cargo +nightly fmt --all -- {{.CARGO_FMT_FLAGS}}
"$HOME/.cargo/bin/cargo" +nightly fmt --all -- {{.CARGO_FMT_FLAGS}}

Not really important but does this work? If so and you'd like to update, there are plenty other similar cases.

rust-lint-configs:
internal: true
run: "once"
cmd: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmd: |-

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.

3 participants