Section 4: Code quality and patterns (STATE_OF_THE_NATION) - #4
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses STATE_OF_THE_NATION.md §4 — Code quality and patterns. Codex review: Approved.
Changes
format_value: removed three local copies ingenerators.py, usePythonCodeSerializer.format_valueeverywhere.save_greetingspecial-case; generic multi-step output mapping usingnext((v for v in [...] if v is not None), None)soFalse,0,""are preserved.main.py(get_version, resolve_spec_path, generate_files) andgenerators.py(template fallback).response=,compliment=, andif v is not Nonein generated code.STATE_OF_THE_NATION.mdsection 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 tofix/section-3-bugs-and-potential-bugsfor a section-4-only diff).Made with Cursor