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

Expose Go post-processing utilities #191

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Expose Go post-processing utilities #191

merged 3 commits into from
Aug 1, 2023

Conversation

K-Phoen
Copy link
Member

@K-Phoen K-Phoen commented Aug 1, 2023

This PR exposes the Go post-processing function, to be used by kindsys and other Go jennies.

Path: fmt.Sprintf("%s_type_gen.go", sch.Lineage().Name()),
Appliers: applyFuncs,
In: []byte(gostr),
IgnoreDiscoveredImports: !cfg.IgnoreDiscoveredImports,
Copy link
Contributor

@joanlopez joanlopez Aug 1, 2023

Choose a reason for hiding this comment

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

Doesn't it look weird that IgnoreDiscoveredImports: !IgnoreDiscoveredImports? 🤔

Indeed, now I think it should be IgnoreDiscoveredImports: cfg.IgnoreDiscoveredImports, because the negation (!) has been added later, when that value is read.

Also, based on the underlying behavior, I'm not sure if the name is clear enough. I guess nothing that cannot be clarified with some extra explanation in form of docs, if needed.

EDIT: Clearly stated here, so 👌🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a copy-pasta mistake, good catch!

@K-Phoen
Copy link
Member Author

K-Phoen commented Aug 1, 2023

Fixed, documented and added a small test case for it :)

Copy link
Contributor

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

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

yeah, definitely worth exposing this

@sdboyer sdboyer merged commit 711d7fd into main Aug 1, 2023
@K-Phoen K-Phoen deleted the expose-go-postprocess branch August 1, 2023 15:13
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.

3 participants