Man, this has an Objective-C section too. Sadly, it turns out that the exact
stuff I just did (pad method prefix).
In case this might help out anyone else, here's a spacing option I found in in
AStyle that seems to address my issue.
--pad-oper / -p
Insert space padding around operators
if (foo==2)
a=bar((b-c)*a,d--);
becomes:
if (foo == 2)
a = bar((b - c) * a, d--);
On Mar 30, 2015, at 2:44 PM, Jonathan Prescott wrote:
> I’ve used a tool called “AStyle” (astyle.sourceforge.net) for several C / C++
> / Objective-C/C++ code bases to address the very same problem you are having.
> As one example, I have a simulation that runs around 1M SLOC, maintained
> over several years by several different “cooks”, that resulted in the same
> problem (in addition, Windows and Unix issues thrown in the mix). When I’m
> merging codebases, having lots of whitespace issues makes a real mess of
> trying to figure out real merge issues.
>
> Astyle is pretty flexible in specifying the output format, and can probably
> accommodate most stylistic conventions one may want to maintain. It’s a
> command line tool, doesn’t mess with the original files, and can recurse
> through whatever directory structure you want. Works on Linux, MacOSX, and
> Windows.
>
> Knows C/C++/Objective-C/Objective-C++/Java syntax.
>
> It’s been useful to me over the years. Hope it can help you.
>
> Jonathan
>
>
>> On Mar 30, 2015, at 2:31 PM, Alex Zavatone <[email protected]> wrote:
>>
>> I've had the pleasure of inheriting an iOS project where the previous
>> programmers took little to no care in formatting with respect to white
>> spaces between almost anything.
>>
>> Readability is quite lacking and while I walk through the multiple view
>> controllers all mashed into one .m file, one of the things I'm doing is
>> making the code legible.
>>
>> With that in mind, I'm hoping that there is a way to specify a search for =,
>> ==, != and * if there the leading and/or trailing characters are not spaces.
>>
>> I'm expecting that this will involve regular expressions to find an
>> alphanumeric char, an = char and another alphanumeric char, then replace
>> with the string of " = ".
>>
>> Is this the right way to go about this?
>>
>> Thanks in advance.
>>
>> Oh, and to whomever implemented Edit All in Scope, you're on my Christmas
>> list.
>>
>> Cheers,
>> Alex Zavatone
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/xcode-users/jprescott12%40icloud.com
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com
This email sent to [email protected]