Skip to content

Refactor changeset functions to impl classes#363

Draft
aiguofer wants to merge 4 commits into
mainfrom
class-refactor-changesets
Draft

Refactor changeset functions to impl classes#363
aiguofer wants to merge 4 commits into
mainfrom
class-refactor-changesets

Conversation

@aiguofer
Copy link
Copy Markdown
Contributor

Please describe the changes made and why they were made. Link to any relevant issues or tickets.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • Ran uv run ruff check . --config pyproject.toml
  • Ran uv run ruff format --config pyproject.toml
  • If this is a bug fix:
    • Updated integration tests with bug repro
    • Linked to bug report ticket
  • Added unit tests if needed
  • Updated unit tests if needed
  • Tests passed when run locally

Each public changeset_* function now delegates to a private _Impl class.
The class holds state (self._refactors, self._refactored, self._current_path)
so helper methods append directly instead of threading entries through
return values. Path accumulation via self._current_path eliminates manual
prefix construction at call sites.

Public function names and signatures are unchanged; refactor.py is untouched.
…iesImpl

Rename to _restructure_owner_node and change return type from Tuple[CommentedMap, bool]
to None. State is mutated directly on self._refactored and self._refactors, eliminating
the tuple unpacking and redundant node reassignment in _process().
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