From 83b4028b131bf357511e5c37f807b5f0462bc1c6 Mon Sep 17 00:00:00 2001 From: Barsik Date: Wed, 3 Jul 2024 11:20:54 +0300 Subject: [PATCH] willbe : warnings --- module/move/willbe/src/action/main_header.rs | 9 +---- .../src/action/readme_health_table_renew.rs | 2 ++ .../Cargo.toml | 2 +- ...e_variadic_tag_configurations_c_trivial.rs | 0 .../src/lib.rs | 0 .../module/test_module/Cargo.toml | 2 +- .../test_module/Cargo.toml | 2 +- .../tests/asset/three_packages/b/Cargo.toml | 4 +-- .../tests/asset/three_packages/c/Cargo.toml | 2 +- .../tests/asset/three_packages/d/Cargo.toml | 2 +- .../three_packages_with_features/b/Cargo.toml | 6 ++-- .../three_packages_with_features/c/Cargo.toml | 2 +- .../three_packages_with_features/d/Cargo.toml | 2 +- .../willbe/tests/inc/action_tests/features.rs | 36 +++++++++---------- .../action_tests/readme_health_table_renew.rs | 12 ++++--- 15 files changed, 41 insertions(+), 42 deletions(-) rename module/move/willbe/tests/asset/full_config/{_willbe_variadic_tag_configurations_c => _willbe_variadic_tag_configurations_full_config_c}/Cargo.toml (77%) rename module/move/willbe/tests/asset/full_config/{_willbe_variadic_tag_configurations_c => _willbe_variadic_tag_configurations_full_config_c}/examples/_willbe_variadic_tag_configurations_c_trivial.rs (100%) rename module/move/willbe/tests/asset/full_config/{_willbe_variadic_tag_configurations_c => _willbe_variadic_tag_configurations_full_config_c}/src/lib.rs (100%) diff --git a/module/move/willbe/src/action/main_header.rs b/module/move/willbe/src/action/main_header.rs index 38920db6a0..7c1b5af526 100644 --- a/module/move/willbe/src/action/main_header.rs +++ b/module/move/willbe/src/action/main_header.rs @@ -15,20 +15,13 @@ mod private }; use std::path::PathBuf; use regex::Regex; - use { CrateDir, query, url, Workspace }; use entity::{ PathError, WorkspaceInitError }; use error:: { err, - // Result, - untyped:: - { - Error, - Context, - }, + untyped::Error, }; use workspace_md_extension::WorkspaceMdExtension; - // use error::ErrWith; static TAGS_TEMPLATE : std::sync::OnceLock< Regex > = std::sync::OnceLock::new(); diff --git a/module/move/willbe/src/action/readme_health_table_renew.rs b/module/move/willbe/src/action/readme_health_table_renew.rs index f767c0a885..5624e89af4 100644 --- a/module/move/willbe/src/action/readme_health_table_renew.rs +++ b/module/move/willbe/src/action/readme_health_table_renew.rs @@ -374,8 +374,10 @@ mod private { Some ( + // qqq : use new-type. for example `CrateDir` stability_get ( + // qqq : the folder name may not match the package name &workspace.workspace_root().join( &table_parameters.base_path ).join( &package_name ) )? ) diff --git a/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/Cargo.toml b/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/Cargo.toml similarity index 77% rename from module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/Cargo.toml rename to module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/Cargo.toml index 4df78cb6f0..289fc79ca1 100644 --- a/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/Cargo.toml +++ b/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_willbe_variadic_tag_configurations_c" +name = "_willbe_variadic_tag_configurations_full_config_c" version = "0.1.0" edition = "2021" diff --git a/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/examples/_willbe_variadic_tag_configurations_c_trivial.rs b/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/examples/_willbe_variadic_tag_configurations_c_trivial.rs similarity index 100% rename from module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/examples/_willbe_variadic_tag_configurations_c_trivial.rs rename to module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/examples/_willbe_variadic_tag_configurations_c_trivial.rs diff --git a/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/src/lib.rs b/module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/src/lib.rs similarity index 100% rename from module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_c/src/lib.rs rename to module/move/willbe/tests/asset/full_config/_willbe_variadic_tag_configurations_full_config_c/src/lib.rs diff --git a/module/move/willbe/tests/asset/single_module_with_example/module/test_module/Cargo.toml b/module/move/willbe/tests/asset/single_module_with_example/module/test_module/Cargo.toml index 64eeb328e8..76dabe6c73 100644 --- a/module/move/willbe/tests/asset/single_module_with_example/module/test_module/Cargo.toml +++ b/module/move/willbe/tests/asset/single_module_with_example/module/test_module/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "test_module" +name = "single_module_with_example_test_module" version = "0.1.0" edition = "2021" repository = "https://github.com/Wandalen/wTools/tree/master/module/move/test_module" diff --git a/module/move/willbe/tests/asset/single_module_without_master_branch_and_discord/test_module/Cargo.toml b/module/move/willbe/tests/asset/single_module_without_master_branch_and_discord/test_module/Cargo.toml index 6f4364e11f..aec6e6f988 100644 --- a/module/move/willbe/tests/asset/single_module_without_master_branch_and_discord/test_module/Cargo.toml +++ b/module/move/willbe/tests/asset/single_module_without_master_branch_and_discord/test_module/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "test_module" +name = "single_module_without_master_branch_and_discord_test_module" version = "0.1.0" edition = "2021" diff --git a/module/move/willbe/tests/asset/three_packages/b/Cargo.toml b/module/move/willbe/tests/asset/three_packages/b/Cargo.toml index f460a5fc09..b7bc4425f5 100644 --- a/module/move/willbe/tests/asset/three_packages/b/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages/b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_b" +name = "_three_packages_b" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/b" @@ -9,4 +9,4 @@ stability = "stable" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -_chain_of_packages_c = { path = "../c" } +_three_packages_c = { path = "../c" } diff --git a/module/move/willbe/tests/asset/three_packages/c/Cargo.toml b/module/move/willbe/tests/asset/three_packages/c/Cargo.toml index 4d263a19f3..28539ecdd1 100644 --- a/module/move/willbe/tests/asset/three_packages/c/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages/c/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_c" +name = "_three_packages_c" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/c" diff --git a/module/move/willbe/tests/asset/three_packages/d/Cargo.toml b/module/move/willbe/tests/asset/three_packages/d/Cargo.toml index 3fc29d91b6..24e9f550b1 100644 --- a/module/move/willbe/tests/asset/three_packages/d/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages/d/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_d" +name = "_three_packages_d" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/c" diff --git a/module/move/willbe/tests/asset/three_packages_with_features/b/Cargo.toml b/module/move/willbe/tests/asset/three_packages_with_features/b/Cargo.toml index b9c97a9443..5d105f6c90 100644 --- a/module/move/willbe/tests/asset/three_packages_with_features/b/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages_with_features/b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_b" +name = "_three_packages_with_features_b" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/b" @@ -9,9 +9,9 @@ stability = "stable" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -_chain_of_packages_c = { path = "../c", optional = true } +_three_packages_with_features_c = { path = "../c", optional = true } [features] enabled = [] default = ["boo"] -boo = ["_chain_of_packages_c"] +boo = ["_three_packages_with_features_c"] diff --git a/module/move/willbe/tests/asset/three_packages_with_features/c/Cargo.toml b/module/move/willbe/tests/asset/three_packages_with_features/c/Cargo.toml index 0bcd46b4e3..e935a23dbc 100644 --- a/module/move/willbe/tests/asset/three_packages_with_features/c/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages_with_features/c/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_c" +name = "_three_packages_with_features_c" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/c" diff --git a/module/move/willbe/tests/asset/three_packages_with_features/d/Cargo.toml b/module/move/willbe/tests/asset/three_packages_with_features/d/Cargo.toml index a6e5f08b8f..45e924ea2b 100644 --- a/module/move/willbe/tests/asset/three_packages_with_features/d/Cargo.toml +++ b/module/move/willbe/tests/asset/three_packages_with_features/d/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "_chain_of_packages_d" +name = "_three_packages_with_features_d" version = "0.1.0" edition = "2021" repository = "https://github.com/Username/test/c" diff --git a/module/move/willbe/tests/inc/action_tests/features.rs b/module/move/willbe/tests/inc/action_tests/features.rs index 5e2607bad8..37a4b63cae 100644 --- a/module/move/willbe/tests/inc/action_tests/features.rs +++ b/module/move/willbe/tests/inc/action_tests/features.rs @@ -29,7 +29,7 @@ fn package_no_features() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b:\ +Package _three_packages_b:\ " ) ); } @@ -48,8 +48,8 @@ fn package_features() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b: -\t_chain_of_packages_c +Package _three_packages_with_features_b: +\t_three_packages_with_features_c \tboo \tdefault \tenabled\ @@ -71,9 +71,9 @@ fn package_features_with_features_deps() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b: -\t_chain_of_packages_c: [dep:_chain_of_packages_c] -\tboo: [_chain_of_packages_c] +Package _three_packages_with_features_b: +\t_three_packages_with_features_c: [dep:_three_packages_with_features_c] +\tboo: [_three_packages_with_features_c] \tdefault: [boo] \tenabled: []\ " ) ); @@ -94,17 +94,17 @@ fn workspace_no_features() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b:\ +Package _three_packages_b:\ " ) ); assert!( report.contains( "\ -Package _chain_of_packages_c:\ +Package _three_packages_c:\ " ) ); assert!( report.contains( "\ -Package _chain_of_packages_d:\ +Package _three_packages_d:\ " ) ); } @@ -123,8 +123,8 @@ fn workspace_features() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b: -\t_chain_of_packages_c +Package _three_packages_with_features_b: +\t_three_packages_with_features_c \tboo \tdefault \tenabled\ @@ -132,7 +132,7 @@ Package _chain_of_packages_b: assert!( report.contains( "\ -Package _chain_of_packages_c: +Package _three_packages_with_features_c: \tdefault \tenabled \tfoo\ @@ -140,7 +140,7 @@ Package _chain_of_packages_c: assert!( report.contains( "\ -Package _chain_of_packages_d: +Package _three_packages_with_features_d: \tenabled\ " ) ); } @@ -161,16 +161,16 @@ fn workspace_features_with_features_deps() // Assert assert!( report.contains( "\ -Package _chain_of_packages_b: -\t_chain_of_packages_c: [dep:_chain_of_packages_c] -\tboo: [_chain_of_packages_c] +Package _three_packages_with_features_b: +\t_three_packages_with_features_c: [dep:_three_packages_with_features_c] +\tboo: [_three_packages_with_features_c] \tdefault: [boo] \tenabled: []\ " ) ); assert!( report.contains( "\ -Package _chain_of_packages_c: +Package _three_packages_with_features_c: \tdefault: [foo] \tenabled: [] \tfoo: []\ @@ -178,7 +178,7 @@ Package _chain_of_packages_c: assert!( report.contains( "\ -Package _chain_of_packages_d: +Package _three_packages_with_features_d: \tenabled: []\ " ) ); } diff --git a/module/move/willbe/tests/inc/action_tests/readme_health_table_renew.rs b/module/move/willbe/tests/inc/action_tests/readme_health_table_renew.rs index 58a745148e..cce1e9065a 100644 --- a/module/move/willbe/tests/inc/action_tests/readme_health_table_renew.rs +++ b/module/move/willbe/tests/inc/action_tests/readme_health_table_renew.rs @@ -128,7 +128,8 @@ fn module_cell() let mut actual = String::new(); _ = file.read_to_string( &mut actual ).unwrap(); - assert!( actual.contains( "[_willbe_variadic_tag_configurations_c](./_willbe_variadic_tag_configurations_c)" ) ); + // qqq : do not do like that. If it will fail how will I know what went wrong? What is the name of the package here? + assert!( actual.contains( "[_willbe_variadic_tag_configurations_full_config_c](./_willbe_variadic_tag_configurations_full_config_c)" ) ); } #[ test ] @@ -163,7 +164,8 @@ fn branches_cell() let mut actual = String::new(); _ = file.read_to_string( &mut actual ).unwrap(); - assert!( actual.contains( "[![rust-status](https://img.shields.io/github/actions/workflow/status/SomeCrate/C/module_willbe_variadic_tag_configurations_c_push.yml?label=&branch=test_branch1)](https://github.com/SomeName/SomeCrate/C/actions/workflows/module_willbe_variadic_tag_configurations_c_push.yml?query=branch%3Atest_branch1) | [![rust-status](https://img.shields.io/github/actions/workflow/status/SomeCrate/C/module_willbe_variadic_tag_configurations_c_push.yml?label=&branch=test_branch2)](https://github.com/SomeName/SomeCrate/C/actions/workflows/module_willbe_variadic_tag_configurations_c_push.yml?query=branch%3Atest_branch2)" ) ); + // qqq : do not do like that. If it will fail how will I know what went wrong? What is the name of the package here? + assert!( actual.contains( "[![rust-status](https://img.shields.io/github/actions/workflow/status/SomeCrate/C/module_willbe_variadic_tag_configurations_full_config_c_push.yml?label=&branch=test_branch1)](https://github.com/SomeName/SomeCrate/C/actions/workflows/module_willbe_variadic_tag_configurations_full_config_c_push.yml?query=branch%3Atest_branch1) | [![rust-status](https://img.shields.io/github/actions/workflow/status/SomeCrate/C/module_willbe_variadic_tag_configurations_full_config_c_push.yml?label=&branch=test_branch2)](https://github.com/SomeName/SomeCrate/C/actions/workflows/module_willbe_variadic_tag_configurations_full_config_c_push.yml?query=branch%3Atest_branch2)" ) ); } #[ test ] @@ -180,7 +182,8 @@ fn docs_cell() let mut actual = String::new(); _ = file.read_to_string( &mut actual ).unwrap(); - assert!( actual.contains( "[![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/_willbe_variadic_tag_configurations_c)" ) ); + // qqq : do not do like that. If it will fail how will I know what went wrong? What is the name of the package here? + assert!( actual.contains( "[![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/_willbe_variadic_tag_configurations_full_config_c)" ) ); } #[ test ] @@ -197,5 +200,6 @@ fn sample_cell() let mut actual = String::new(); _ = file.read_to_string( &mut actual ).unwrap(); - assert!( actual.contains( " [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=.%2F_willbe_variadic_tag_configurations_c%2Fexamples%2F_willbe_variadic_tag_configurations_c_trivial.rs,RUN_POSTFIX=--example%20_willbe_variadic_tag_configurations_c_trivial/https://github.com/SomeName/SomeCrate/C)" ) ); + // qqq : do not do like that. If it will fail how will I know what went wrong? What is the name of the package here? + assert!( actual.contains( " [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=.%2F_willbe_variadic_tag_configurations_full_config_c%2Fexamples%2F_willbe_variadic_tag_configurations_c_trivial.rs,RUN_POSTFIX=--example%20_willbe_variadic_tag_configurations_c_trivial/https://github.com/SomeName/SomeCrate/C)" ) ); }