Reputation: 25983
We've inherited a codebase with a lot of naked if statements, like so:
if (some_condition)
do_something();
Our house style forbids this, so I'd like (if possible) for it to be a compiler warning. Can I do that in XCode, and if so, how?
Upvotes: 1
Views: 262
Reputation: 6479
trojanfoe is right, there's no way to get a warning. You can check that by putting -Weverything
in your "Build Settings" in "Other Warning Flags".
Uncrustify is a pretty good code beautifier for many languages, including Objective-C. The config takes some time to setup, for your if-statements you want:
# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'.
mod_full_brace_if = force
Upvotes: 3