Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #39

Merged
merged 25 commits into from
Jun 4, 2024
Merged

Refactoring #39

merged 25 commits into from
Jun 4, 2024

Conversation

ChrisTerBeke
Copy link
Collaborator

@ChrisTerBeke ChrisTerBeke commented May 24, 2024

What

  • Refactored the codebase to resolve some issues with weird (and near cyclic) dependencies
  • Created a store package that groups all logic around the file system operations
  • Re-named download to client and merged it with HTTP logic for listing versions
  • De-duplicated code where possible
  • Moved some code into functions so that the name can be used as self documentation (reduces need for inline comments)
  • Removed nested statements where possible
  • Added early returns where possible
  • Removed github.com/tfversion from the internal package name
  • Fixed some edge cases around listing and deleting aliases

All commands now only import their corresponding package or the helpers. All packages now only import client, helpers or store, with the exception of use -> install for the auto install feature.

Why

  • Better readability and maintainability

@github-actions github-actions bot added the tests label May 24, 2024
@ChrisTerBeke ChrisTerBeke changed the title Extract path manipulation to separate package (part 1) Refactoring May 24, 2024
@ChrisTerBeke ChrisTerBeke marked this pull request as ready for review May 24, 2024 17:40
Copy link
Collaborator

@mmourick mmourick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🗿

@ChrisTerBeke ChrisTerBeke merged commit 8d593ee into main Jun 4, 2024
4 checks passed
@ChrisTerBeke ChrisTerBeke deleted the improve/code-structure branch June 4, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants