refactor(writes): simplify cli writes pipeline#71
Merged
Conversation
- Collapse `is_collection` two-step logic to `not remainder`
- Drop unused `is_collection_path` param from `_attach`; drop unused `schema_op`/`resource_name` params from `_classify`
- Fold `synthesized` intermediate var into single `operation_id =` expression
- Extract `is_object_like` to eliminate duplicate `top_level in (...)` test
- Replace double `model_extra or {}` double-access with a single `extras` var in `_classify_top_level`, `_object_branch`, and `_collect_sensitive_paths`
- Simplify `_collect_sensitive_paths` ref-cycle guard: track `schema.ref` only (the ref we entered with)
- Replace `getattr(schema, "format", None)` with direct `schema.format` (typed field)
No behaviour changes. All tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- preflight: drop redundant `expected=None` (field default) - bulk: use try/except/else to eliminate dead `continue` at loop-body end - apply: fold _OTHER_SENSITIVE_HEADERS into _redact, lowering k once per iteration - input: remove what-comments from _classify_brace_start and _parse_text No behaviour changes. 608 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
thomaschristory
added a commit
that referenced
this pull request
May 16, 2026
Maintenance release: codebase-wide simplification pass (#61-#71), documentation parity audit (#73), urllib3 2.6.3->2.7.0 (#46). No CLI/config/output-contract changes vs v1.0.3. Co-authored-by: Thomas Christory <tchristory@partner.auchan.fr> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #53
Simplify pass on
nsc/cli/writes/. No behaviour changes. All tests pass.expected=Nonekeyword arg (field default is alreadyNone)continueat end of except-block withtry/except/else— thecontinuewas dead (end of loop body) but semantically load-bearing;elsemakes the intent explicit_OTHER_SENSITIVE_HEADERSmodule constant by inlining into_redact; computek.lower()once per iteration instead of twice_classify_brace_startand_parse_text(comments described code behaviour, not intent)608 tests pass, mypy --strict clean, ruff clean.