chore(bottlecap): cross-platform test and code cleanups#1211
Merged
lucaspimentel merged 6 commits intomainfrom Apr 24, 2026
Merged
chore(bottlecap): cross-platform test and code cleanups#1211lucaspimentel merged 6 commits intomainfrom
lucaspimentel merged 6 commits intomainfrom
Conversation
Ensures *.sh and *.bash files are checked out with LF line endings on Windows, so they execute correctly inside Linux Docker containers.
The three resolve_runtime / resolve_provided tests hard-coded a Linux temp path that does not exist by default on Windows, causing them to race on a fresh machine depending on which test triggered the directory creation first. std::env::temp_dir returns a directory that always exists on every supported platform, removing the bootstrap race.
- Prefix unused `path` parameter with `_` to silence unused_variables. - Use `io::Error::other` per `clippy::io_other_error`. Both changes apply to the existing `#[cfg(target_os = "windows")]` stub in the file; no behavior change.
The function is only used internally; removing pub aligns visibility across platforms. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Avoids a potential panic when the temp directory path contains non-UTF-8 characters. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
1 task
duncanista
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Portable test and code cleanups in bottlecap. No behavior change on Linux.
.gitattributes: force LF for*.sh/*.bash. Shell scripts now check out with LF on every platform, so a CRLF-prone checkout (e.g. Windows) still executes cleanly inside Linux Docker containers.bottlecap/src/tags/lambda/tags.rs, the threetags::lambda::tags::tests::test_resolve_*tests:/tmp/...path tostd::env::temp_dir(). Removes a bootstrap race between tests that were implicitly sharing a filesystem side effect through the same path.to_string_lossy()so a non-UTF-8 temp dir does not panic the test.test_resolve_runtimenow cleans up the file it created.bottlecap/src/metrics/enhanced/statfs.rs:statfs_infoisfnon both targets. It's an internal helper;pubwas only present on the non-Windows branch.#[cfg(target_os = "windows")]stub now usesio::Error::other(..)(perclippy::io_other_error) and prefixes its unusedpathwith_.Testing
cargo checkon Linux: clean.cargo test --lib tags::lambda::tags::: 8 passed, 0 failed.