Skip to content

Commit 2ccbff5

Browse files
committed
chore(former): Comment out debug attributes in tests
1 parent 6f71f96 commit 2ccbff5

File tree

9 files changed

+31
-21
lines changed

9 files changed

+31
-21
lines changed

module/core/former/examples/former_custom_subform_scalar.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fn main()
3737

3838
// Child struct with Former derived for builder pattern support
3939
#[ derive( Debug, PartialEq, Former ) ]
40-
// Optional: Use `#[debug]` to expand and debug generated code.
41-
// #[debug]
40+
// Optional: Use `#[ debug ]` to expand and debug generated code.
41+
// #[ debug ]
4242
pub struct Child
4343
{
4444
name : String,
@@ -47,8 +47,8 @@ fn main()
4747

4848
// Parent struct designed to hold a single Child instance using subform scalar
4949
#[ derive( Debug, PartialEq, Former ) ]
50-
// Optional: Use `#[debug]` to expand and debug generated code.
51-
// #[debug]
50+
// Optional: Use `#[ debug ]` to expand and debug generated code.
51+
// #[ debug ]
5252
pub struct Parent
5353
{
5454
// The `subform_scalar` attribute is used to specify that the 'child' field has its own former

module/core/former/tests/inc/enum_named_tests/enum_named_fields_named_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//!
1717
//! Test Relevance/Acceptance Criteria:
1818
//! - Defines an enum `EnumWithNamedFields` with named variants covering zero, one, and two fields.
19-
//! - Applies `#[derive(Former)]`, `#[debug]`, and `#[standalone_constructors]` to the enum.
19+
//! - Applies `#[derive(Former)]`, `#[ debug ]`, and `#[standalone_constructors]` to the enum.
2020
//! - Applies `#[scalar]` and `#[subform_scalar]` to relevant variants.
2121
//! - Includes shared test logic from `enum_named_fields_named_only_test.rs`.
2222
//! - The included tests call the derived static methods (e.g., `EnumWithNamedFields::variant_zero_scalar()`, `EnumWithNamedFields::variant_one_scalar()`, `EnumWithNamedFields::variant_one_subform()`, etc.) and standalone constructors (e.g., `standalone_variant_zero_scalar()`).
@@ -33,7 +33,7 @@ pub struct InnerForSubform {
3333

3434
// Define the enum with named field variants for testing.
3535
#[ derive( Debug, PartialEq, former::Former ) ]
36-
#[ debug ]
36+
// #[ debug ]
3737
#[ standalone_constructors ]
3838
pub enum EnumWithNamedFields
3939
{

module/core/former/tests/inc/enum_named_tests/standalone_constructor_args_named_derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//!
1414
//! Test Relevance/Acceptance Criteria:
1515
//! - Defines an enum `TestEnumArgs` with single-field (`StructVariantArgs { field: String }`) and multi-field (`MultiStructArgs { a: i32, b: bool }`) named variants.
16-
//! - Applies `#[derive(Former)]`, `#[standalone_constructors]`, and `#[debug]` to the enum.
16+
//! - Applies `#[derive(Former)]`, `#[standalone_constructors]`, and `#[ debug ]` to the enum.
1717
//! - Applies `#[arg_for_constructor]` to the fields within both variants.
1818
//! - Includes shared test logic from `standalone_constructor_args_named_only_test.rs`.
1919
//! - The included tests call the derived standalone constructor functions (`struct_variant_args(value)`, `multi_struct_args(value1, value2)`) and assert that the returned enum instances match manually constructed expected values. This verifies that the standalone constructors are generated correctly as scalar functions when all fields have `#[arg_for_constructor]`.

module/core/former/tests/inc/enum_unit_tests/enum_named_fields_unit_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! Test Relevance/Acceptance Criteria:
1111
//! - Defines an enum `EnumWithNamedFields` with unit variants `UnitVariantDefault` and `UnitVariantScalar`,
1212
//! using named fields syntax (`{}`). `UnitVariantScalar` has the `#[scalar]` attribute. The enum has
13-
//! `#[derive(Former)]`, `#[debug]`, and `#[standalone_constructors]`.
13+
//! `#[derive(Former)]`, `#[ debug ]`, and `#[standalone_constructors]`.
1414
//! - Relies on the derived static methods (`EnumWithNamedFields::unit_variant_scalar()`, `EnumWithNamedFields::unit_variant_default()`)
1515
//! defined in `enum_named_fields_unit_only_test.rs`.
1616
//! - Asserts that these constructors produce the correct `EnumWithNamedFields` enum instances by comparing
@@ -20,7 +20,7 @@ use super::*;
2020

2121
// Define the enum with unit variants for testing.
2222
#[ derive( Debug, PartialEq, former::Former ) ]
23-
#[ debug ]
23+
// #[ debug ]
2424
#[ standalone_constructors ]
2525
pub enum EnumWithNamedFields
2626
{

module/core/former/tests/inc/enum_unit_tests/generic_enum_simple_unit_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! - Rule 1a (Unit + `#[scalar]`): Verifies `EnumOuter::<T>::other_variant() -> EnumOuter<T>` (as default for unit is scalar) for a generic enum.
88
//!
99
//! Test Relevance/Acceptance Criteria:
10-
//! - Defines a generic enum `EnumOuter<X: Copy>` with a unit variant `OtherVariant`, and the `#[derive(Former)]` and `#[debug]` attributes.
10+
//! - Defines a generic enum `EnumOuter<X: Copy>` with a unit variant `OtherVariant`, and the `#[derive(Former)]` and `#[ debug ]` attributes.
1111
//! - Relies on the derived static method `EnumOuter::<MyType>::other_variant()`.
1212
//! - Asserts that the `got` instance is equal to an `expected` instance, which is manually
1313
//! constructed as `EnumOuter::<MyType>::OtherVariant`. This confirms the constructor produces the correct variant instance for a generic enum.
@@ -19,7 +19,7 @@ use core::fmt::Debug; // Import Debug trait for bounds
1919
// --- Enum Definition with Bounds ---
2020
// Apply Former derive here. This is what we are testing.
2121
#[derive(Debug, PartialEq, former::Former)]
22-
// #[debug]
22+
// #[ debug ]
2323
pub enum EnumOuter< X : Copy + Debug + PartialEq > // Enum bound: Copy + Debug + PartialEq
2424
{
2525
// --- Unit Variant ---

module/core/former/tests/inc/enum_unit_tests/generics_in_tuple_variant_unit_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! - Rule 1a (Unit + `#[scalar]`): Verifies `EnumOuter::<T>::other_variant() -> EnumOuter<T>` (as default for unit is scalar) for a generic enum.
88
//!
99
//! Test Relevance/Acceptance Criteria:
10-
//! - Defines a generic enum `EnumOuter<X: Copy>` with a unit variant `OtherVariant`, and the `#[derive(Former)]` and `#[debug]` attributes.
10+
//! - Defines a generic enum `EnumOuter<X: Copy>` with a unit variant `OtherVariant`, and the `#[derive(Former)]` and `#[ debug ]` attributes.
1111
//! - Relies on the derived static method `EnumOuter::<MyType>::other_variant()`.
1212
//! - Asserts that the `got` instance is equal to an `expected` instance, which is manually
1313
//! constructed as `EnumOuter::<MyType>::OtherVariant`. This confirms the constructor produces the correct variant instance for a generic enum.
@@ -19,7 +19,7 @@ use std::marker::PhantomData; // Import PhantomData
1919
// --- Enum Definition with Bounds ---
2020
// Apply Former derive here. This is what we are testing.
2121
#[derive(Debug, PartialEq, former::Former)]
22-
// #[debug]
22+
// #[ debug ]
2323
pub enum EnumOuter< X : Copy > // Enum bound: Copy
2424
{
2525
// --- Unit Variant ---

module/core/former/tests/inc/enum_unnamed_tests/enum_named_fields_unnamed_derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!
1010
//! Test Relevance/Acceptance Criteria:
1111
//! - Defines an enum `EnumWithNamedFields` with two zero-field unnamed variants: `VariantZeroUnnamedDefault()` and `VariantZeroUnnamedScalar()`.
12-
//! - `VariantZeroUnnamedScalar` is annotated with `#[scalar]`. The enum has `#[derive(Former)]`, `#[debug]`, and `#[standalone_constructors]`.
12+
//! - `VariantZeroUnnamedScalar` is annotated with `#[scalar]`. The enum has `#[derive(Former)]`, `#[ debug ]`, and `#[standalone_constructors]`.
1313
//! - Relies on the derived static methods (`EnumWithNamedFields::variant_zero_unnamed_scalar()`, `EnumWithNamedFields::variant_zero_unnamed_default()`)
1414
//! defined in `enum_named_fields_unnamed_only_test.rs`.
1515
//! - Asserts that these constructors produce the correct `EnumWithNamedFields` enum instances by comparing

module/core/former/tests/inc/enum_unnamed_tests/generics_in_tuple_variant_tuple_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! Test Relevance/Acceptance Criteria:
1010
//! - Defines a generic enum `EnumOuter<X: Copy + Debug + Default + PartialEq>` with a single-field tuple variant `Variant(InnerGeneric<X>)`.
1111
//! - The inner struct `InnerGeneric<T: Debug + Copy + Default + PartialEq>` has its own generic `T` and bounds, and is instantiated with the enum's generic `X` in the variant.
12-
//! - The enum has `#[derive(Former)]` and `#[debug]`.
12+
//! - The enum has `#[derive(Former)]` and `#[ debug ]`.
1313
//! - Relies on the derived static method `EnumOuter::<X>::variant()` provided by this file (via `include!`).
1414
//! - Asserts that this constructor returns the expected subformer (`InnerGenericFormer<X>`) and that using the subformer's setter (`.inner_field()`) and `.form()` results in the correct `EnumOuter` enum instance.
1515
//! - Verifies that the bounds (`Copy`, `Debug`, `Default`, `PartialEq`) are correctly handled by using types that satisfy them.
@@ -35,7 +35,7 @@ impl< T : Debug + Copy + Default + PartialEq > From< T > for InnerGeneric< T >
3535
// --- Enum Definition with Bounds ---
3636
// Apply Former derive here. This is what we are testing.
3737
#[derive(Debug, PartialEq, former::Former)]
38-
// #[debug]
38+
// #[ debug ]
3939
pub enum EnumOuter< X : Copy + Debug + Default + PartialEq > // Enum bound: Copy
4040
{
4141
// --- Tuple Variant with Generics ---

plan.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Project Plan: Audit, Improve, and Run Clippy Lints for `former` Crate
22

33
### Goal
4-
* Audit, improve, and run `module/core/former/task_clippy_lints.md` to ensure it follows codestyle rules, has concise documentation, and avoids breaking the working crate. **Additionally, ensure `cargo test` passes for the `former` crate without any warnings.**
4+
* Audit, improve, and run `module/core/former/task_clippy_lints.md` to ensure it follows codestyle rules, has concise documentation, and avoids breaking the working crate. **Additionally, ensure `cargo test` passes for the `former` crate without any warnings and without debug output from `#[ debug ]` attributes.**
55

66
### Progress
77
* 🚀 Increment 1 Complete
88
* 🚀 Increment 2 Complete
99
* 🚀 Increment 3 Complete
1010
* 🚀 Increment 4 Complete
1111
* 🚀 Increment 5 Complete
12+
* 🚀 Increment 6 Complete
1213

1314
### Target Crate
1415
* `module/core/former`
@@ -19,16 +20,15 @@
1920
* `module/core/former/Cargo.toml`
2021
* `module/core/former/src/lib.rs`
2122
* `Cargo.toml` (workspace root)
22-
* `module/core/former/tests/inc/enum_unit_tests/generic_enum_simple_unit_derive.rs`
23-
* `module/core/former/tests/inc/enum_unnamed_tests/tuple_zero_fields_derive.rs`
24-
* `module/core/former/tests/inc/enum_unnamed_tests/tuple_zero_fields_manual.rs`
23+
* All test files within `module/core/former/tests/` that contain `#[ debug ]`.
2524
* Crates for Documentation:
2625
* `former`
2726

2827
### Expected Behavior Rules / Specifications (for Target Crate)
2928
* The `module/core/former/task_clippy_lints.md` file should be well-formatted, concise, and adhere to the codestyle rules.
3029
* The `module/core/former` crate should compile without warnings when `cargo clippy -p former` is run with the recommended lints.
31-
* `cargo test -p former` should pass without errors **and without any warnings.**
30+
* `cargo test -p former` should pass without errors and without any warnings.
31+
* **`cargo test -p former` should not produce any debug output related to `#[ debug ]` attributes.**
3232
* No existing knowledge or functionality should be lost or broken.
3333

3434
### Increments
@@ -80,6 +80,16 @@
8080
* Verification Strategy: Execute `cargo test -p former` via `execute_command` and analyze output for warnings.
8181
* Commit Message: `fix(former): Resolve cargo test warnings`
8282

83+
* ✅ Increment 6: Comment out active `#[ debug ]` attributes in `former` crate tests.
84+
* Detailed Plan Step 1: Search for `#[ debug ]` in `module/core/former/tests/` directory.
85+
* Detailed Plan Step 2: For each file found, read its content.
86+
* Detailed Plan Step 3: Comment out all occurrences of `#[ debug ]` attributes.
87+
* Pre-Analysis: `#[ debug ]` attributes are used for macro debugging and should not be active in final code.
88+
* Crucial Design Rules: [Enhancements: Only Implement What’s Requested].
89+
* Relevant Behavior Rules: `cargo test -p former` should not produce debug output.
90+
* Verification Strategy: Execute `cargo test -p former` via `execute_command` and visually inspect output for debug messages.
91+
* Commit Message: `chore(former): Comment out debug attributes in tests`
92+
8393
### Task Requirements
8494
* Do only conservative changes.
8595
* Avoid breaking working crate.

0 commit comments

Comments
 (0)