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

can specify the output format as text or json #106

Merged
merged 8 commits into from
Apr 9, 2024

Conversation

goddenrich
Copy link
Contributor

previously we would print the contents of the updated formatted build files to stdout as text. It can be useful for linters to be able to output as json for easier parsing especially when multiple files are updated at once.

cmd/puku/puku.go Outdated Show resolved Hide resolved
@goddenrich goddenrich force-pushed the output-format branch 2 times, most recently from be08655 to 7227a28 Compare April 9, 2024 09:57
@@ -122,12 +123,24 @@ func (g *Graph) loadFile(path string) (*build.File, error) {
return build.ParseBuild(validFilename, nil)
}

func (g *Graph) FormatFiles(write bool, out io.Writer) error {
func (g *Graph) FormatFilesWithWriter(out io.Writer, format string) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe should be FormatFilesToWriter

Copy link
Contributor

@samwestmoreland samwestmoreland left a comment

Choose a reason for hiding this comment

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

Lgtm!

graph/graph.go Outdated Show resolved Hide resolved
graph/graph.go Outdated Show resolved Hide resolved
graph/graph.go Outdated Show resolved Hide resolved
graph/graph.go Outdated Show resolved Hide resolved
@goddenrich goddenrich merged commit 61ed21a into please-build:master Apr 9, 2024
3 checks passed
@goddenrich goddenrich deleted the output-format branch April 9, 2024 11:51
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