mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
refactor: move format_settings function to separate file
This commit is contained in:
parent
de56792f90
commit
43d3cf2c71
2 changed files with 18 additions and 16 deletions
|
@ -0,0 +1,17 @@
|
|||
from aider.utils import scrub_sensitive_info
|
||||
|
||||
def format_settings(parser, args):
|
||||
show = scrub_sensitive_info(args, parser.format_values())
|
||||
# clean up the headings for consistency w/ new lines
|
||||
heading_env = "Environment Variables:"
|
||||
heading_defaults = "Defaults:"
|
||||
if heading_env in show:
|
||||
show = show.replace(heading_env, "\n" + heading_env)
|
||||
show = show.replace(heading_defaults, "\n" + heading_defaults)
|
||||
show += "\n"
|
||||
show += "Option settings:\n"
|
||||
for arg, val in sorted(vars(args).items()):
|
||||
if val:
|
||||
val = scrub_sensitive_info(args, str(val))
|
||||
show += f" - {arg}: {val}\n" # noqa: E221
|
||||
return show
|
Loading…
Add table
Add a link
Reference in a new issue