Context: As identified in review of PR #346 additional diagnostics should be implemented to ensure user migration to the v6+ series. Version v6.0 specifically will introduce new behavior without fully replacing legacy behavior, thus users should be made aware that the change is coming.
Goal: implement a function to generate a list of warnings based on the invoked arguments:
E.g., consider:
def emit_deprecation_warnings(args: CustomNamespace) -> list[str]:
"""Return list of deprecation warning messages."""
warnings_list = []
if args.with_license_file and not args.with_license_files:
warnings_list.append(
f"DEPRECATION WARNING (v6.0):\n"
f" --with-license-file is deprecated.\n"
f" Use --with-license-files instead.\n"
f" See: {__repo_url__}/issues/242"
)
return warnings_list
This allows for integration via the exsisting: create_warn_string function, E.g.:
def create_warn_string(args: CustomNamespace) -> str:
warn_messages = emit_deprecation_warnings(args) # NEW
warn = partial(output_colored, "33")
# ... existing warning logic ...
Context: As identified in review of PR #346 additional diagnostics should be implemented to ensure user migration to the v6+ series. Version v6.0 specifically will introduce new behavior without fully replacing legacy behavior, thus users should be made aware that the change is coming.
Goal: implement a function to generate a list of warnings based on the invoked arguments:
E.g., consider:
This allows for integration via the exsisting:
create_warn_stringfunction, E.g.: