Skip to content

Fix clippy::semicolon_if_nothing_returned warnings#222

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-clippy-warning-semicolon
Closed

Fix clippy::semicolon_if_nothing_returned warnings#222
Copilot wants to merge 2 commits intomainfrom
copilot/fix-clippy-warning-semicolon

Conversation

Copy link
Copy Markdown

Copilot AI commented Oct 13, 2025

This PR fixes all clippy::semicolon_if_nothing_returned warnings across the codebase by adding semicolons to statements that don't return values.

Background

The clippy::semicolon_if_nothing_returned lint is part of the pedantic group enabled in our workspace configuration. It requires adding semicolons to the end of statements that are evaluated for their side effects rather than their return value, ensuring consistent formatting throughout the codebase.

Changes

Applied automatic fixes using cargo clippy --fix to add semicolons in:

  • Test assertions: Added semicolons after assert!, assert_eq!, etc. at the end of test closures
  • If-let blocks: Added semicolons after statements with side effects (e.g., pre_exec.run()?;)
  • Closure bodies: Added semicolons to the final statement when closures don't return a value

Example Fixes

Test assertions:

// Before
with_unique_cache_path("test", |cache_path| {
    assert_eq!(value, expected)
})

// After
with_unique_cache_path("test", |cache_path| {
    assert_eq!(value, expected);
});

Side effects in if-let:

// Before
if let Some(pre_exec) = pre_exec {
    pre_exec.run()?
};

// After
if let Some(pre_exec) = pre_exec {
    pre_exec.run()?;
};

Impact

  • 19 files modified across multiple crates (vite_task, vite_path, vite_package_manager, fspy)
  • No functional changes: All tests pass, no behavior modifications
  • 0 remaining warnings for clippy::semicolon_if_nothing_returned
  • Improves code consistency and satisfies pedantic lint requirements
Original prompt

Fix clippy warning: clippy::semicolon_if_nothing_returned


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Brooooooklyn <3468483+Brooooooklyn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix clippy warning for semicolon if nothing returned Fix clippy::semicolon_if_nothing_returned warnings Oct 13, 2025
Copilot AI requested a review from Brooooooklyn October 13, 2025 03:14
@Brooooooklyn
Copy link
Copy Markdown
Member

@copilot resolve confict

Copy link
Copy Markdown
Author

Copilot AI commented Oct 13, 2025

@copilot resolve confict

I'm unable to resolve the merge conflict automatically because I cannot fetch the latest changes from the main branch due to authentication limitations in this environment.

The main branch has moved ahead with 3 new commits since this PR was created:

These commits modify some of the same files I changed (crates/vite_task/src/config/mod.rs and crates/vite_task/src/schedule.rs), which is causing the conflict.

To resolve this conflict, you'll need to:

  1. Manually rebase this branch onto the latest main branch
  2. Run cargo clippy --fix --allow-dirty --allow-staged --all-targets -- -W clippy::semicolon_if_nothing_returned to re-apply the semicolon fixes
  3. Test that everything builds and passes tests

Alternatively, you could close this PR and I can create a fresh one based on the current main branch.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/voidzero-dev/vite-plus/contents/crates/vite_task/src/config/mod.rs
    • Triggering command: curl -L -H Accept: application/vnd.github.v3.raw REDACTED -o /tmp/config_mod_main.rs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

2 participants