Skip to content

[FIX] odev: sort help arguments and fix alignment#152

Merged
sea-odoo merged 3 commits into
betafrom
fix-help-alignment-and-sorting
Apr 28, 2026
Merged

[FIX] odev: sort help arguments and fix alignment#152
sea-odoo merged 3 commits into
betafrom
fix-help-alignment-and-sorting

Conversation

@sea-odoo
Copy link
Copy Markdown
Contributor

@sea-odoo sea-odoo commented Apr 27, 2026

Summary

This PR fixes two major issues in the odev help output:

  1. Argument Sorting: Arguments are now sorted alphabetically, with positionals always first and greedy catch-all arguments last.
  2. Alignment Fix: A long-standing bug where the first line of indented blocks was misaligned has been resolved by unifying indentation management.

Changes

  • Updated Command.convert_arguments in base.py to implement complex sorting logic.
  • Refactored string.normalize_indent to use inspect.cleandoc for reliable docstring normalization.
  • Fixed HelpCommand templates in help.py to use a column-0 placeholder pattern, preventing double indentation of the first line.
  • Fixed format_options_list in string.py to return uniformly indented blocks.

Screenshots / Recordings

Before

image

After

image

Assisted-by: antigravity noreply@google.com

@sea-odoo sea-odoo changed the base branch from main to beta April 27, 2026 18:14
@sea-odoo sea-odoo requested a review from brinkflew April 27, 2026 18:14
Comment thread odev/common/string.py Outdated
- Arguments in `odev help <command>` are now sorted alphabetically (positionals first, optionals next, greedy catch-all last).
- Fixed a long-standing alignment bug in the help output where the first line of an indented block (arguments, descriptions, command lists) was often double-indented or misaligned.
- Refactored `string.normalize_indent` to use `inspect.cleandoc` for more robust docstring handling.
- Unified indentation management in `HelpCommand` by using a consistent column-0 placeholder pattern.

Assisted-by: antigravity <noreply@google.com>
- Fix positional argument sorting in base.py to preserve declaration order,
  preventing regressions in commands like 'restore'.
- Improve logging.py to avoid misinterpreting '-v' from tools like pytest
  as a log level.

Assisted-by: antigravity <noreply@google.com>
Assisted-by: gemini-3-flash <noreply@google.com>
@sea-odoo sea-odoo force-pushed the fix-help-alignment-and-sorting branch from 93d28a0 to cbd4df5 Compare April 28, 2026 12:28
@sea-odoo sea-odoo merged commit 90dfdb9 into beta Apr 28, 2026
5 of 6 checks passed
@sea-odoo sea-odoo deleted the fix-help-alignment-and-sorting branch April 28, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants