Skip to content

lint: deny map_err_ignore and unused_result_ok repo-wide - #14530

Merged
TrapsterDK merged 1 commit into
mainfrom
cloud/13800
Nov 21, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
cloud/13800

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #13800
Closes #14484

Adds -Dclippy::map_err_ignore and -Dclippy::unused_result_ok to .bazelrc and core/quality/tiers/clippy/strict.txt, adds both to LINTS in tools/ci/lint_attributes_test.rs, and lists them on the strict tier in docs/cli/commands/quality.md. Consumers on the strict tier now get both lints.

Takes both lints out of every per-crate and per-module #[deny(..)] (89 files, including the module-level ones in cli/exec_reports); lists that drop back to indexing_slicing, string_slice use the one-line form.

Fixes the 22 sites the repo-wide flag found (in cli/archive, audit, depcheck, diff, dx_config, fingerprint, fuzz_run, gomod, lock tests, ocaml_cc_driver, semver, shim, the adopt test, and tools/testing/determinism_check):

  • write!/writeln!(..).ok() into a String becomes push_str(&format!(..)).
  • Errors with useful detail keep it: the archive UTF-8 error, BUILD_WORKSPACE_DIRECTORY errors in the schema bins, the fixture resolver variable, and the --shard parse error.
  • Others use .ok().ok_or_else(..).

rustfmt also reformatted a few touched files that were not formatted on main (tools/testing/analysis_scaling_check.rs, determinism_check.rs, deploy/private/src/bin_nfpm_stage.rs, cli/lock/src/lib.rs tests).

Tested: tools/dx lint //cli/... and tools/dx check --apply on all touched files report neither lint. bazel test -k --build_tests_only on the 73 touched packages plus //cli/cli:dx_cli_test, //cli/cli/tests/adopt:adopt_test and //tools/ci:lint_attributes_test: 314 pass. strict_tier_and_bazelrc_deny_the_same_rust_lints passes. These fail the same way on main, on files this PR does not touch: the //tools/ci guard tests (lint_attributes_test's panic_family_expects… for cli/exec_quality/src/testing.rs and no_source_discards… for cli/codegen_shard and deploy/private/src/crates.rs; zero_compat, prose_rules, pin_locations, aggregate_gates, config_consistency, and other allowlist drift), //tools/testing/nested:dx_nested_test (rules_flutter pin) and //cli/generate:dx_generate_test (read-only file system in the cloud sandbox).


Generated by Claude Code

Moves clippy::map_err_ignore and clippy::unused_result_ok from per-crate
#![deny] attributes into .bazelrc and the strict clippy tier, adds both to
the lint_attributes_test LINTS list, and fixes the 22 remaining sites in
cli/archive, audit, depcheck, diff, dx_config, fingerprint, fuzz_run,
gomod, lock tests, ocaml_cc_driver, semver, shim, the adopt test and
tools/testing/determinism_check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2i1LGG35HHijhcHmpFH
@TrapsterDK TrapsterDK added the train Tested; land via merge train label Nov 21, 2026 — with Claude

Copy link
Copy Markdown
Collaborator Author

analysis (PR-time checks on linux_x86_64) fails on main too, not because of this PR. On main 8c9c770, the base of this PR, bazel mod show_repo --lockfile_mode=error --repo_env=CARGO_BAZEL_DIGEST_CHECK=1 @crates @dx_quality_crates @dx_thrift_crates gives the same Digests do not match: Current Digest("7440405e…") != Expected Digest("56870eb4…") for dx_crates. This PR changes no Cargo manifest, lockfile or crate spec. The fix is a dx_crates repin on main.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

affected tests (linux_x86_64, shard 17) didn't finish because the runner got a shutdown signal (exit 143). Before that, //javascript/tests/fixtures/fuzz:parse_fuzz_run_test failed once. On this PR's head (cda0cd8), bazel test //javascript/tests/fixtures/fuzz:parse_fuzz_run_test passes locally: Jazzer.js finds the FU crash the test expects. The only cli/fuzz_run change here is the Crowbar --seconds parse, .map_err(|_| usage()) → .ok().ok_or_else(usage), which behaves the same. The shard needs a re-run.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

The affected-tests failures in shards 4 and 12 are not this PR's. I checked them locally on this PR's head (cda0cd8) and on main 8c9c770:

  • //config:workspace_policy, //core/modules:consumer_deps_test, //core/modules:versions_contract and //core/modules/tests:loaders_test fail on both. //cli/generate:dx_generate_test also fails locally on this branch with a read-only file system error, and this PR only drops a deny attribute in that crate.
  • //deploy/private:dx_deploy_tools_test is flaky on main: with --runs_per_test=6 --nocache_test_results it failed 4 of 6 runs on main and 5 of 6 on this branch. Different tests fail each run (pub_dev::tests::publish_keeps_the_token_out_of_argv, tool_failure_is_reported_without_the_token, pypi::tests::pypi_live_upload_*, npm::tests::npm_pack_installs_into_a_local_consumer). They panic with write script body: … BrokenPipe or exit status: 127 while writing fake tool scripts, which points to a race in that test support. This PR only drops deny attributes and reformats in deploy/private.
  • //deploy/private/release:dx_release_tools_test timed out in CI but passes locally on this branch in 38s.

Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shards 19 and 15 aren't this PR's either:

  • Shard 19 stops at //patches:readme_generated with patches/README.md: rules_scala has no override in MODULE.bazel. That's the main failure tracked in patches: README render fails on main, rules_scala rows still in the override table after #14409 #14470. The rest of the shard was aborted after it.
  • Shard 15 fails only in gazelle tests (//gazelle/csharp:generation_test, //gazelle/julia:stdlib_test, //gazelle/ocaml:ocaml_test, and timeouts in //gazelle/kotlin:compile_test and //gazelle/scala/tests:compile_test). This PR changes no gazelle code or Go sources, only Rust lint attributes, the clippy tier and .bazelrc clippy flags.

Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 26 failed before any test ran: dx: invalid_scope: unsupported scope "@llvm//tests/stage0_features:stage0_features_test". The affected-tests plan put an external-repo label in the shard, and dx test accepts only main-workspace scopes. That's a bug in the CI plan or workflow, not in this PR's code: this PR changes nothing under @llvm, patches/llvm, or the affected-tests planner.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 22 fails only in //rust/tests:rust_analyzer_acquisition_test, and it fails the same way on main 8c9c770. Run locally on main and on this branch, it gives rust-analyzer: error while loading shared libraries: librustc_driver-7ed0375ae352bd75.so: cannot open shared object file. The rust-analyzer 1.99.1 runfiles don't include the rustc driver library. This PR doesn't touch the Rust toolchain or rust-analyzer setup.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 13 fails only in //elixir/tests/conformance:coverage_test, and it fails the same way on main 8c9c770. Run locally on main and on this branch, it gives subject_matches_mode panicking with no SF: for greet.ex (an empty Elixir LCOV report). This PR doesn't touch Elixir or coverage collection.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 11's two failures, //core/tests:pins and //csharp/tests/fixtures/xunit:csharp_coverage_test_on, fail the same way on main 8c9c770 when run locally. pins reports julia_src_libllvm/libunwind/libuv url names the version. This PR doesn't touch pins, Julia or C#. Shard 27 hit the same external-label planner error as shard 26 (@rules_cuda//tests/coverage:coverage_disabled_test).


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 0 fails only in //android/tests/fixtures/android_library:kotlin_screen_kotlinc_with_sdk and kotlin_screen_kotlinc_without_sdk. Both fail the same way on main 8c9c770 when run locally: want one KotlincCheck action (Expected "1", but got "0"). This PR doesn't touch Android, Kotlin or the quality aspects.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 25's failures are not this PR's:

  • //tools/docs/typescript/extract:dx_docs_typescript_extract_test and //tools/testing:module_extension_srcs_test fail the same way on main 8c9c770 when run locally.
  • //tools/testing:language_skeleton_test is a known main failure.
  • //tools/testing/nested:dx_nested_test fails on main on the rules_flutter pin (see my earlier comment).
  • //tools/ide:lsp_headless_rust_analyzer_test hits the rust-analyzer librustc_driver problem from shard 22.
  • //tools/testing/consumer:{apple,dart,root_module}_consumer_test are nested consumer tests. This PR doesn't touch apple, dart or the consumer setup.

Shard 18 was cut off by a runner shutdown signal (exit 143), the same as shard 17.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 24 isn't this PR's. Locally, all 16 //tools/ci guard tests that failed in this shard, plus //tools/docs/ir/ir:site_shard_test and //tools/docs/languages:languages_test, fail the same way on main 8c9c770 and on this branch. I checked the two tests this PR touches:

  • lint_attributes_test has the same two failing cases on both, no_source_discards_a_result_unseen_by_the_lints and panic_family_expects_stay_in_test_support_or_the_allowlist, flagging files this PR doesn't touch. The new strict_tier_and_bazelrc_deny_the_same_rust_lints case passes.
  • config_consistency_test fails only docs_name_the_bazel_floor on both.

//tools/docs/site:browser_test timed out in CI.


Generated by Claude Code

@TrapsterDK
TrapsterDK merged commit b0bba8e into main Nov 21, 2026
17 of 33 checks passed
@TrapsterDK
TrapsterDK deleted the cloud/13800 branch November 21, 2026 22:21
TrapsterDK pushed a commit that referenced this pull request Nov 22, 2026
…sult_ok denies (part of #12395)

#14530 added both clippy denies to the rendered .bazelrc but left the
renders_rust inline snapshot behind, so //cli/generate:dx_generate_test
fails on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hz7pt5D3ebRnkfBrgN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

train Tested; land via merge train

Projects

None yet

2 participants