Skip to content

[Repo Assist] ci: add linux-check job and fix two clippy warnings #59

@github-actions

Description

@github-actions

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Two changes that together enable reliable Linux CI for this repository:

1. Fix two clippy warnings (Linux-exposed)

src/cli_backend.rs:45 — collapse nested if (clippy::collapsible_if):

// Before
if !output.status.success() {
    if strict || stdout.trim().is_empty() {}
}
// After
if !output.status.success() && (strict || stdout.trim().is_empty()) {}

src/cli_backend.rs:283 — remove unnecessary .to_string() on a &str slice (clippy::unnecessary_to_owned):

// Before
detail.id = sanitize_text(&trimmed[..bracket_end].to_string());
// After
detail.id = sanitize_text(&trimmed[..bracket_end]);
```

Both warnings are errors under `-D warnings` and were blocking a clean Linux CI run.

### 2. Add `linux-check` CI job

Adds a new job to `ci.yml` that runs on `ubuntu-latest`:
- `cargo fmt -- --check`
- `cargo clippy -- -D warnings`  
- `cargo test` (all 14 unit tests pass without `winget`)

**Benefits:**
- Linux VMs provision ~2× faster than Windows, giving quicker PR feedback for format/lint/test issues
- Unit tests work cross-platform and should be verified on both platforms
- The existing Windows `check` job remains unchanged for full Windows coverage

## Test Status

```
cargo clippy -- -D warnings  →  clean (Linux)
cargo fmt -- --check         →  clean
cargo test                   →  ok. 14 passed (Linux)

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

Warning

🛡️ Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files: .github/workflows/ci.yml.

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission. A human must create the pull request manually.

To create a pull request with the changes:

# Download the patch from the workflow run
gh run download 23541033689 -n agent-artifacts -D /tmp/agent-artifacts-23541033689

# Create a new branch
git checkout -b repo-assist/eng-linux-ci-and-clippy-2026-03-25-406086bc2256adc3 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-artifacts-23541033689/aw-repo-assist-eng-linux-ci-and-clippy-2026-03-25.patch

# Push the branch and create the pull request
git push origin repo-assist/eng-linux-ci-and-clippy-2026-03-25-406086bc2256adc3
gh pr create --title '[Repo Assist] ci: add linux-check job and fix two clippy warnings' --base main --head repo-assist/eng-linux-ci-and-clippy-2026-03-25-406086bc2256adc3 --repo shanselman/winget-tui

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions