Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cli/adopt/src/avro_cpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ fn load_modules(root: &Path, text: &str) -> Result<Vec<ModuleFile>, AdoptError>
.map_err(|error| error.into_error(refuse))
}

fn plan_overrides(
includes: &[ModuleFile],
out: &mut String,
) -> Result<(), AdoptError> {
fn plan_overrides(includes: &[ModuleFile], out: &mut String) -> Result<(), AdoptError> {
let file = ModuleFile::parse(out).map_err(refuse)?;
if any_override(&file, includes, FMT_MODULE).is_none() {
append(
Expand Down
2 changes: 1 addition & 1 deletion cli/adopt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ mod local_paths_tests;

pub use avro_cpp::{AvroCpp, plan_avro_cpp};
pub use error::AdoptError;
pub use user_patches::{UserPatches, plan_user_patches};
pub use families::{
consumer_file_extensions, consumer_quality_marks, detected_families, file_extensions,
quality_marks,
Expand Down Expand Up @@ -97,6 +96,7 @@ pub use upgrade::{
override_missing_base_message, suppression_lines, tool_swaps, upgrade_recovery_message,
upgrade_retry_command,
};
pub use user_patches::{UserPatches, plan_user_patches};
pub use version::{
DX_VERSION, MODULE_VERSION, local_path_overrides, module_dependency_status,
module_rules_dx_version, pin_is_valid, pin_rewrite_hint, read_module_dependency,
Expand Down
12 changes: 8 additions & 4 deletions cli/adopt/src/user_patches_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ fn leaves_an_override_at_another_version_and_warns() {
assert!(plan.edits.is_empty(), "{plan:?}");
assert_eq!(
plan.notes,
["warning: MODULE.bazel pins foo to another version than 2.0.0, so the rules_dx patches for foo do not apply"]
[
"warning: MODULE.bazel pins foo to another version than 2.0.0, so the rules_dx patches for foo do not apply"
]
);
}

Expand Down Expand Up @@ -212,9 +214,11 @@ fn drops_the_include_patches_and_merged_labels_when_the_fix_ships() {
fn gives_a_go_consumer_a_root_sdk_that_shadows_the_others() {
let (_dir, plan) = plan_for(CONSUMER, &[GO]);
let text = edited(&plan, INCLUDE);
assert!(text.contains(
"bazel_dep(name = \"rules_go\", version = \"0.65.0\", dev_dependency = True)\n"
));
assert!(
text.contains(
"bazel_dep(name = \"rules_go\", version = \"0.65.0\", dev_dependency = True)\n"
)
);
assert!(text.contains(
"dx_go_sdk = use_extension(\"@rules_go//go:extensions.bzl\", \"go_sdk\", dev_dependency = True)\n"
));
Expand Down
7 changes: 2 additions & 5 deletions cli/cli/src/exec/audit_consumer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ mod tests {

use super::super::audit_live_tests::{AuditRunner, seed_yanked, write_advisory, write_cached};
use super::super::test_support::Harness;
use std::path::Path;
use super::super::test_support::{event_kinds, json_events};
use std::path::Path;

fn uv_module() -> String {
let v0 = manifest_of(Ecosystem::Uv);
Expand Down Expand Up @@ -215,10 +215,7 @@ source = { registry = "https://pypi.org/simple" }
let (code, out, err) = audited("patched", &lock_with(&packages), Some(&combined), &[]);
assert_eq!(code, 0, "{out}{err}");
assert!(out.contains("audit_security_clean"), "{out}");
assert!(
!out.contains("vuln/"),
"{out}"
);
assert!(!out.contains("vuln/"), "{out}");
}

#[test]
Expand Down
6 changes: 5 additions & 1 deletion cli/cli/src/exec/audit_live_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ fn yanked_rel(key: &str) -> String {
format!(".dx/local/advisory/{TEST_AUDIT_TODAY}/{family}.json")
}

fn edit_yanked(harness: &Harness, key: &str, edit: &dyn Fn(&mut serde_json::Map<String, serde_json::Value>)) {
fn edit_yanked(
harness: &Harness,
key: &str,
edit: &dyn Fn(&mut serde_json::Map<String, serde_json::Value>),
) {
let rel = yanked_rel(key);
let mut map = std::fs::read_to_string(harness.workspace.join(&rel))
.ok()
Expand Down
1 change: 0 additions & 1 deletion cli/plan/src/args/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,6 @@ command_args! {
since: SinceFlag,
base: BaseFlag,
};
#[expect(clippy::struct_field_names, reason = "the fields are the clap argument ids")]
Coverage => 8, BazelTail, {
output: OutputFlag,
fail_on: FailOnFlag,
Expand Down
3 changes: 2 additions & 1 deletion cli/plan/src/resolve/fake_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ impl FakeQuery {
}

pub(crate) fn serving(mut self, url: &str, body: &str) -> Self {
self.registry.insert(url.to_owned(), body.as_bytes().to_vec());
self.registry
.insert(url.to_owned(), body.as_bytes().to_vec());
self
}

Expand Down
Loading