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

More in depth refactoring of providers and modules #108

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cam72cam
Copy link
Contributor

@cam72cam cam72cam commented Dec 14, 2023

WIP

Fixes #30

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
There's still a lot of copy-paste in the command structure

I'll probably address that in a subsequent PR

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Copy link
Contributor

@janosdebugs janosdebugs left a comment

Choose a reason for hiding this comment

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

I wonder if adding a golangci-lint config and CI as part of this refactor would be a good thing. That way any issues with the code could now be caught early.

"log/slog"
)

type Repository struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this seems to be called sometimes without log, maybe adding explicit constructor(s), even if not exported, would be beneficial? That would document what the required parameters are.

ghClient: c.ghClient,
func (c Client) Repository(owner, name string, log *slog.Logger) Repository {
return Repository{
client: Client{
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not need a log here? See my comment about constructors.

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.

Consider refactoring Module/Provider structs to split between identifier and data
2 participants