Enhancing Tuist Output with xcbeautify: Seeking Customization Options

Hello Tuist Community!

I hope this message finds you well. We’re currently utilizing Tuist to run our tests and are taking full advantage of the fantastic selective tests feature. However, we’re looking to enhance our command output by integrating some customization options, specifically by passing arguments to xcbeautify.

One particular feature we’re interested in is the quiet mode of xcbeautify, which we believe could streamline our output and make it more user-friendly.

• Is there a current way to pass xcbeautify arguments through Tuist?

• If not, would this be a beneficial addition to the Tuist framework?

I’d love to hear your thoughts and any insights on this topic. Thank you for your help!

Hey @pakko972 :wave:

No, there’s currently no way to pass options to the xcbeautify, afaik. However, I do think it would be valuable addition to be able to run:

tuist build --quiet
tuist test --quiet

And both commands would only print errors and warnings. I believe @antti from Ouru raised a need for a similar functionality in Slack.

Would you be up to put up a draft PR? I believe we’d need to add a new quiet logger type here. You can see how --verbose is implemented as both options would work similarly.

@pepicrft, what do you think? Let’s align first before diving into the implementation. We’d most likely add this flag across commands, so we shouldn’t take the decision lightly.

There are two needs:

  • Control the verbosity, which you can currently do with the --verbose
  • Customize the output of the underlying xcbeautify tool.

With the --quiet suggestion, the following combination is possible, which I find a bit confusing if I come across it:

tuist --verbose --quiet

I wonder if we should use a different name that makes it more obvious that you are controlling the logs of xcodebuild:

tuist --verbose --xcodebuild-log-quiet

# We'd need to check if we can parse the following one
tuist --verbose --xcbeautify-args '--quiet'

I personally like the second one from above:

  • We make it clear that we are using xcbeautify internally. I don’t think we gain anything by hiding it.
  • It’s very flexible since you can pass any argument.

I don’t think that should be possible. Those should be exclusive. We’d throw an error if you passed both. --verbose and --quiet pair is quite standard across CLI tools.

If we do add --quiet, it should be implemented across all our commands and not just limited to the build output as that’s what a CLI user would expect (e.g., that’s how swift --quiet behaves). The con of this approach is that we still might end up with users who’d want to still get the standard Tuist output and a quiet xcbeautify log – should we cater for that scenario? I don’t know, I’m slightly leaning to “no”.

As for --xcodebuild-log-quiet or --xcbeautify-args, I’m leaning to --xcodebuild-log-quiet. That way, the option works both for xcodebuild output when you use --verbose and for --xcbeautify if you don’t.

I didn’t know about this flag being standard. In that case seems reasonable. I did a quick search to see if there’s any pattern about applying that to a sub-component of the CLI (e.g. make quiet the xcodebuild logs), but I couldn’t find anything.

I’d say then let’s implement --quiet and we’ll see if there’s a need for applying --quiet only to xcbeautify.

I created an issue for this: Add --quiet flag · Issue #6905 · tuist/tuist · GitHub