Skip to content
Merged
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
2 changes: 1 addition & 1 deletion module/core/former_meta/src/derive_former.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ r"derive : Former
item : {item}",
);
diag::report_print( about, original_input, debug );
};
}

Ok( former_mutator_code )
}
Expand Down
311 changes: 157 additions & 154 deletions module/core/former_meta/src/derive_former/former_enum.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions module/core/former_meta/src/derive_former/former_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ specific needs of the broader forming context. It mandates the implementation of
let ( perform, perform_output, perform_generics ) = struct_attrs.performer()?;

/* fields: Process struct fields and storage_fields attribute. */
let fields = derive::named_fields( &ast )?;
let fields = derive::named_fields( ast )?;
// Create FormerField representation for actual struct fields.
let formed_fields : Vec< _ > = fields
.iter()
Expand Down Expand Up @@ -226,7 +226,7 @@ specific needs of the broader forming context. It mandates the implementation of
field.former_field_setter
(
item,
&original_input,
original_input,
&struct_generics_impl,
&struct_generics_ty,
&struct_generics_where,
Expand All @@ -244,7 +244,7 @@ specific needs of the broader forming context. It mandates the implementation of
// Collect preform logic results.
let storage_field_preform : Vec< _ > = storage_field_preform.into_iter().collect::< Result< _ > >()?;
// Generate mutator implementation code.
let former_mutator_code = mutator( item, &original_input, &struct_attrs.mutator, &former_definition_types, &former_definition_types_generics_impl, &former_definition_types_generics_ty, &former_definition_types_generics_where )?;
let former_mutator_code = mutator( item, original_input, &struct_attrs.mutator, &former_definition_types, &former_definition_types_generics_impl, &former_definition_types_generics_ty, &former_definition_types_generics_where )?;

// <<< Start of updated code for standalone constructor >>>
let standalone_constructor_code = if struct_attrs.standalone_constructors.value( false )
Expand Down
4 changes: 2 additions & 2 deletions module/core/former_types/src/forming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ impl< Definition : crate::FormerDefinitionTypes > FormingEndClosure< Definition
/// # Parameters
///
/// * `closure` - A closure that matches the expected signature for transforming a collection
/// and context into a new context. This closure is stored and called by the
/// `call` method of the `FormingEnd` trait implementation.
/// and context into a new context. This closure is stored and called by the
/// `call` method of the `FormingEnd` trait implementation.
///
/// # Returns
///
Expand Down
1 change: 1 addition & 0 deletions module/core/macro_tools/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mod private
/// assert_eq!( got_normal.to_string(), "my_var" );
/// assert_eq!( got_keyword.to_string(), "r#fn" );
/// ```
#[must_use]
pub fn ident_maybe_raw( ident : &syn::Ident ) -> Ident
{
let name = ident.to_string();
Expand Down
2 changes: 1 addition & 1 deletion module/core/macro_tools/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mod private
},
// Do nothing for unit structs
syn::Fields::Unit => {}
};
}

new_input
}
Expand Down
2 changes: 1 addition & 1 deletion module/core/macro_tools/src/phantom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mod private
}
)
}
};
}

input
}
Expand Down
4 changes: 2 additions & 2 deletions module/core/macro_tools/src/typ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ mod private
/// ```
/// # Panics
/// qqq: doc
#[ allow( clippy::cast_possible_wrap ) ]
pub fn type_parameters< 'a >( ty : &'a syn::Type, range : impl NonIterableInterval ) -> Vec< &'a syn::Type >
#[ allow( clippy::cast_possible_wrap, clippy::needless_pass_by_value ) ]
pub fn type_parameters( ty : &syn::Type, range : impl NonIterableInterval ) -> Vec< &syn::Type >
{
if let syn::Type::Path( syn::TypePath{ path : syn::Path { ref segments, .. }, .. } ) = ty
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/mod_interface_meta/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ mod private
syn::Result::Ok( () )
})?;
}
};
}

syn::Result::Ok( () )
})?;
Expand Down
4 changes: 2 additions & 2 deletions module/core/mod_interface_meta/src/use_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mod private
{
return Err( syn_err!( "Complex group uses like `use module1::{ module2, module3 }` are not supported." ) );
},
};
}
}

Ok( path )
Expand Down Expand Up @@ -187,7 +187,7 @@ mod private
group = true;
break;
},
};
}
}

Ok( Self
Expand Down
2 changes: 1 addition & 1 deletion module/core/pth/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ mod private
/// # Returns
///
/// * `Option<String>` - The common directory path shared by all paths, if it exists.
/// If no common directory path exists, returns `None`.
/// If no common directory path exists, returns `None`.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion module/move/wca/src/ca/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ mod private

println!( "Help command\n\n{text}" );
}
};
}

Ok::< _, error_tools::untyped::Error >( () )
};
Expand Down
3 changes: 2 additions & 1 deletion module/move/wca/src/ca/tool/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod private
{
#[ allow( clippy::wildcard_imports ) ]
use crate::*;
use core::fmt::Write;

// use wtools::error::{ Result, err };
// use error::err;
Expand Down Expand Up @@ -116,7 +117,7 @@ mod private
{
for ( i, cell ) in row.0.iter().enumerate()
{
formatted_table.push_str( &format!( "{:width$}", cell, width = max_lengths[ i ] ) );
write!( formatted_table, "{:width$}", cell, width = max_lengths[ i ] ).expect( "Writing to String shouldn't fail" );
formatted_table.push( ' ' );
}
formatted_table.pop(); // trailing space
Expand Down
2 changes: 1 addition & 1 deletion module/move/wca/src/ca/verifier/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ mod private
{
#[ cfg( feature = "on_unknown_suggest" ) ]
if let Some( phrase ) = Self::suggest_command( dictionary, &raw_command.name ) {
return VerificationError::CommandNotFound { name_suggestion: Some( phrase.to_string() ), command_info: None };
return Err( VerificationError::CommandNotFound { name_suggestion: Some( phrase.to_string() ), command_info: None } );
}
VerificationError::CommandNotFound { name_suggestion: None, command_info: None }
})?;
Expand Down
26 changes: 17 additions & 9 deletions module/move/willbe/src/action/crate_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ mod private
typed::Error,
ErrWith,
};
use core::fmt;
use std::
{
ffi::OsString,
fs,
path::PathBuf,
fmt,
};
use collection_tools::HashMap;
use toml_edit::Document;
Expand Down Expand Up @@ -101,16 +101,24 @@ mod private
///
/// # Returns
/// Returns `Ok(CrateDocReport)` if successful, otherwise returns `Err((CrateDocReport, CrateDocError))`.
///
/// # Errors
/// Returns an error if the command arguments are invalid, the workspace cannot be loaded
#[allow(clippy::too_many_lines)]
pub fn doc
(
workspace : &Workspace,
crate_dir : CrateDir,
crate_dir : &CrateDir,
output_path_req : Option< PathBuf >,
) -> ResultWithReport< CrateDocReport, CrateDocError >
{
let mut report = CrateDocReport::default();
report.crate_dir = Some( crate_dir.clone() );
report.status = format!( "Starting documentation generation for {}", crate_dir.as_ref().display() );
let mut report = CrateDocReport
{
crate_dir : Some( crate_dir.clone() ),
status : format!( "Starting documentation generation for {}", crate_dir.as_ref().display() ),
..Default::default()
};


// --- Get crate name early for --package argument and file naming ---
let manifest_path_for_name = crate_dir.as_ref().join( "Cargo.toml" );
Expand Down Expand Up @@ -159,7 +167,7 @@ mod private
Err( r ) =>
{
report.cargo_doc_report = Some( r.clone() );
report.status = format!( "Failed during `cargo doc` execution for `{}`.", crate_name );
report.status = format!( "Failed during `cargo doc` execution for `{crate_name}`." );
}
}

Expand All @@ -172,7 +180,7 @@ mod private
let json_path = workspace
.target_directory()
.join( "doc" )
.join( format!( "{}.json", crate_name ) );
.join( format!( "{crate_name}.json" ) );

// Check if JSON file exists and read it
if !json_path.exists()
Expand Down Expand Up @@ -219,7 +227,7 @@ mod private
workspace
.target_directory()
.join( "doc" )
.join( format!( "{}_doc.md", crate_name ) )
.join( format!( "{crate_name}_doc.md" ) )
}
};

Expand All @@ -241,7 +249,7 @@ mod private
.context( format!( "Failed to write Markdown documentation to {}", output_md_abs_path.display() ) )
.err_with_report( &report )?;

report.status = format!( "Markdown documentation generated successfully for `{}`", crate_name );
report.status = format!( "Markdown documentation generated successfully for `{crate_name}`" );

Ok( report )
}
Expand Down
2 changes: 1 addition & 1 deletion module/move/willbe/src/action/deploy_renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mod private
// qqq : for Kos : bad description
let current_dir = current_dir
.components()
.last()
.next_back()
.context( "Invalid current directory" )?;

let current_dir = current_dir.as_os_str().to_string_lossy();
Expand Down
17 changes: 7 additions & 10 deletions module/move/willbe/src/action/readme_health_table_renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ mod private
{
#[ allow( clippy::wildcard_imports ) ]
use crate::*;

use std::
{
fmt::Write as FmtWrite,
fs::{ OpenOptions, File },
io::{ Write, Read, Seek, SeekFrom },
};
Expand Down Expand Up @@ -522,14 +522,11 @@ ensure that at least one remotest is present in git. ",
}
if table_parameters.include_docs
{
rou.push_str
write!
(
&format!
(
" [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/{}) |",
&module_name
)
);
rou,
" [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/{module_name}) |"
).expect( "Writing to String shouldn't fail" );
}
if table_parameters.include
{
Expand All @@ -540,7 +537,7 @@ ensure that at least one remotest is present in git. ",
{
let path = path.to_string_lossy().replace( '\\', "/" ).replace( '/', "%2F" );
let tmp = name.to_string_lossy().replace( '\\', "/" );
let file_name = tmp.split( '/' ).last().unwrap();
let file_name = tmp.split( '/' ).next_back().unwrap();
let name = file_name.strip_suffix( ".rs" ).unwrap();
format!
(
Expand All @@ -555,7 +552,7 @@ ensure that at least one remotest is present in git. ",
{
String::new()
};
rou.push_str( &format!( " {example} |" ) );
write!(rou, " {example} |").expect( "Writing to String shouldn't fail" );
}
format!( "{rou}\n" )
}
Expand Down
7 changes: 4 additions & 3 deletions module/move/willbe/src/command/crate_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod private
/// # Errors
/// Returns an error if the command arguments are invalid, the workspace cannot be loaded,
/// or if the documentation generation action fails.
#[allow(clippy::needless_pass_by_value)]
pub fn crate_doc( o : VerifiedCommand ) -> error::untyped::Result< () >
{
let path_arg : PathBuf = o.args.get_owned( 0 ).unwrap_or_else( || "./".into() );
Expand Down Expand Up @@ -53,16 +54,16 @@ mod private
let output_path_req : Option< PathBuf > = o.props.get_owned( "output" );

// Call the action, passing the workspace reference
match action::crate_doc::doc( &workspace, crate_dir, output_path_req )
match action::crate_doc::doc( &workspace, &crate_dir, output_path_req )
{
Ok( report ) =>
{
println!( "{}", report ); // Print the success report
println!( "{report}" ); // Print the success report
Ok( () )
}
Err( ( report, e ) ) =>
{
eprintln!( "{}", report ); // Print the report even on failure
eprintln!( "{report}" ); // Print the report even on failure
// Convert the specific CrateDocError into a general untyped::Error for the command return
Err( Error::new( e ).context( "Documentation generation failed" ) )
}
Expand Down
2 changes: 1 addition & 1 deletion module/move/willbe/src/command/readme_headers_renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mod private
report.main_header_renew_report = r;
report.main_header_renew_error = Some( error );
}
};
}
match action::readme_modules_headers_renew( crate_dir )
{
Ok( r ) =>
Expand Down
10 changes: 5 additions & 5 deletions module/move/willbe/src/entity/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mod private
Diff::Same( () ) => writeln!( f, " {}", path.display() )?,
Diff::Add( () ) => writeln!( f, "+ {} NEW", path.to_string_lossy().green() )?,
Diff::Rem( () ) => writeln!( f, "- {} REMOVED", path.to_string_lossy().red() )?,
};
}
}
DiffItem::Content( items ) =>
{
Expand All @@ -133,11 +133,11 @@ mod private
Diff::Same( t ) => write!( f, "| {t}" )?,
Diff::Add( t ) => write!( f, "| + {}", t.green() )?,
Diff::Rem( t ) => write!( f, "| - {}", t.red() )?,
};
}
}
writeln!( f, "{}", "=".repeat( len + 2 ) )?;
}
};
}
}

Ok( () )
Expand All @@ -152,9 +152,9 @@ mod private
/// # Arguments
///
/// * `left`: A reference to the first crate archive.
/// Changes that are present here but lacking in 'right' are classified as additions.
/// Changes that are present here but lacking in 'right' are classified as additions.
/// * `right`: A reference to the second crate archive.
/// Changes not found in 'left' but present in 'right' are classified as removals.
/// Changes not found in 'left' but present in 'right' are classified as removals.
///
/// # Returns
///
Expand Down
4 changes: 2 additions & 2 deletions module/move/willbe/src/entity/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ mod private
/// # Args :
/// - `manifest` - a manifest mutable reference
/// - `dry` - a flag that indicates whether to apply the changes or not
/// - `true` - does not modify the manifest file, but only returns the new version;
/// - `false` - overwrites the manifest file with the new version.
/// - `true` - does not modify the manifest file, but only returns the new version;
/// - `false` - overwrites the manifest file with the new version.
///
/// # Returns :
/// - `Ok` - the new version number as a string;
Expand Down
4 changes: 2 additions & 2 deletions module/move/willbe/src/entity/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ mod private
.packages()
.find( | &p |
{
if !formed.crate_dir.include( p ) { return false };
if !formed.manifest_file.include( p ) { return false };
if !formed.crate_dir.include( p ) { return false }
if !formed.manifest_file.include( p ) { return false }
true
})
// .unwrap()
Expand Down
Loading
Loading