Attempts to load global configuration and merge it with CLI arguments to produce an EffectiveConfig.
Returns Result<EffectiveConfig, AppError> if successful, or AppError if something goes wrong.
Filters out doc comments (/// and //!) if remove_doc_comments is true.
Otherwise, leaves them intact. Does not remove or modify any other lines.
Keeps all attributes, normal comments, indentation, whitespace, etc.
Removes doc comment lines (/// or //!) if remove_doc_comments = true.
Keeps all other lines intact, including attributes (#[...]), normal // comments,
indentation, and whitespace. No inline truncation or other modifications are made.
Removes all doc comments (///, //!), attribute lines (#[...]), and normal // comments
when remove_doc_comments = true. Also handles inline // in code lines by truncation, preserving whitespace.
Removes attribute lines (#[...]) and normal // comment lines, but keeps doc lines (///, //!)
when remove_doc_comments = false. Also handles inline // in code lines by truncation, preserving whitespace.