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

Refactor CliArguments to conform to RepoConfiguration's Builder Pattern #2117

Closed
asdfghjkxd opened this issue Feb 17, 2024 · 0 comments · Fixed by #2118
Closed

Refactor CliArguments to conform to RepoConfiguration's Builder Pattern #2117

asdfghjkxd opened this issue Feb 17, 2024 · 0 comments · Fixed by #2118

Comments

@asdfghjkxd
Copy link
Contributor

What feature(s) would you like to see in RepoSense

Currently, CliArguments' Builder patterns is not in line with how RepoConfiguration's Builder pattern was implemented.

As observed in PR #2078, the Builder objects in the codebase are not being reused, and the Builder pattern was adopted as a way to reduce constructor complexity and increase flexibility in how we as developers can construct RepoConfiguration or CliArguments objects. The current implementation of the Builder pattern for CliArguments assumes that Builder objects will be reused, but since this is not the case for most parts of the codebase, refactoring the Builder class might be beneficial for reducing duplication of class attributes and for increasing overall code equality.

We could look into refactoring CliArguments in such a way that it conforms to RepoConfiguration's implementation of the Builder pattern.

Is the feature request related to a problem?

This refactoring is related to issue #2076 and PR #2078.

If possible, describe the solution

We can adopt the variation of the Builder pattern as detailed in #2078, by simplifying the Builder objects by storing an instance of CliArguments within the Builder object, and building into that instance directly, reducing attribute duplication.

If applicable, describe alternatives you've considered

N/A

Additional context

N/A

@asdfghjkxd asdfghjkxd self-assigned this Feb 17, 2024
ckcherry23 pushed a commit that referenced this issue Mar 2, 2024
…uilder Pattern (#2118)

Current implementation of the Builder pattern within `CliArguments`
does not conform that in `RepoConfiguration`.

Let's move to refactor `CliArguments` to reduce class attribute
duplication across `CliArguments` and `CliArguments::Builder` and to
enhance overall code quality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed/Completed
Development

Successfully merging a pull request may close this issue.

1 participant