Skip to content

Section 4: Code quality and patterns (STATE_OF_THE_NATION) - #4

Merged
aswhitehouse merged 1 commit into
mainfrom
fix/section-4-code-quality
Feb 28, 2026
Merged

aswhitehouse merged 1 commit into
mainfrom
fix/section-4-code-quality

Conversation

@aswhitehouse

Copy link
Copy Markdown
Collaborator

Addresses STATE_OF_THE_NATION.md §4 — Code quality and patterns. Codex review: Approved.

Changes

Area Change
4.1 Duplication Single format_value: removed three local copies in generators.py, use PythonCodeSerializer.format_value everywhere.
4.2 Magic task name Removed save_greeting special-case; generic multi-step output mapping using next((v for v in [...] if v is not None), None) so False, 0, "" are preserved.
4.2 Bare except Narrowed to specific exceptions in main.py (get_version, resolve_spec_path, generate_files) and generators.py (template fallback).
Tests Multi-step test asserts response=, compliment=, and if v is not None in generated code.
Docs STATE_OF_THE_NATION.md section 4.1/4.2 updated: format_value, save_greeting, bare Exception, deprecated API marked Resolved/Partly resolved.

Note: This branch is built on fix/section-3-bugs-and-potential-bugs. If section 3 is not merged yet, either merge section 3 first or use this PR to review section 4 (base can be changed to fix/section-3-bugs-and-potential-bugs for a section-4-only diff).

Made with Cursor

…xceptions, docs

- generators.py: use PythonCodeSerializer.format_value; remove save_greeting
  magic; generic multi-step output mapping with next(.. if v is not None)
- main.py: narrow except to (ModuleNotFoundError, AttributeError), (OSError,
  FileNotFoundError), (OSError, ValueError, KeyError, TypeError, RuntimeError)
- generators.py: template fallback except (OSError, ValueError, KeyError,
  TypeError, RuntimeError)
- tests: assert response=, compliment=, if v is not None in multi-step output
- STATE_OF_THE_NATION.md: mark format_value, save_greeting, bare Exception,
  deprecated API as Resolved/Partly resolved in section 4

Made-with: Cursor
@aswhitehouse
aswhitehouse merged commit 54fbea6 into main Feb 28, 2026
1 check passed
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.

1 participant