Repository navigation
lint: keep the error in tools/ci, tools/testing, tools/api and examples (part of #13801) - #14222
Merged
Merged
Conversation
…es (part of #13801) Every map_err(|_| ..) in these trees appends the original error, and every statement-position .ok() either writes into a String with push_str, reports the failure, or propagates it. starlark_harness::finish now returns io::Result<i32>; main maps Err to FAILURE, so exit codes stay the same. Crate roots in tools/ci, tools/testing and tools/api deny clippy::map_err_ignore and clippy::unused_result_ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
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.
Part of #13801.
Changes
tools/ci,tools/testing,tools/api: everymap_err(|_| ..)now appends: {error}to its existing message. Statement-position.ok()onwrite!into aStringbecomespush_str(&format!(..)).tools/testing/hermetic/src/lib.rs:timelineuseseprintln!when the write fails.tools/testing/nested/src/lib.rs: the Windowsremove_dirfallback returns anio::Errorthat keeps the original kind and both messages.tools/testing/starlark_harness.rs:finishreturnsio::Result<i32>, andmainmapsErrtoExitCode::FAILURE, so exit codes stay the same. The broken-stdout test now assertsErr.tools/testing/process_probe: adds aT::Err: Displaybound.tools/ci,tools/testingandtools/apidenyclippy::map_err_ignoreandclippy::unused_result_ok.examples/gets the fixes but no deny attribute:CommandError::BadIdgains aParseIntErrorfield. This is a public API change in the example.parse_boardadvances au32id withchecked_add.consumer_testuseseprintln!.Testing
tools/dx lint //tools/ci/... //tools/testing/... //tools/api/... //examples/shared-rust:{tasks_model,tasks_core,tasks} //examples/adopt-polyglot:consumer_test: no findings for either lint. The only error isclippy::absurd_extreme_comparisonsintools/ci/determinism_allowlist_test.rs, which this PR does not touch. I reran it with both-Dflags added to.bazelrclocally (not committed) and got the same result.//examples/...as a whole fails analysis on main, for reasons unrelated to this PR:tasks_interfaceclang aspect and the rules_go toolchain fortasks_wasi.tools/dx teston the 13 named targets: 12 passed.//tools/ci:lint_attributes_testfails oncli/codegen_shard/src/writer.rs: drop(writeln!(..)) discards the write error. This PR does not touch that file.appcontainer_runandisolation_windows_probe, and the nested-Bazel/consumer tests (including//examples/adopt-polyglot:consumer_test). CI covers them.Remaining on #13801
deploy/private/**(~60 sites).bazelrc-Dflip, which waits on rust: deny unused_result_ok and map_err_ignore in the remaining cli/* crates #13800. It must also add both lints tocore/quality/tiers/clippy/strict.txt.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K