square / spacecommander

Commit fully-formatted Objective-C as a team without even trying.
Other
1.13k stars 177 forks source link

Ignoring files #5

Closed stevenle closed 9 years ago

stevenle commented 9 years ago

Is there any way to ignore files other than #pragma Formatter Exempt? I'm using protocol buffers which get recompiled on every build, would prefer to be able to ignore these files using a glob, e.g.: *.pbobjc.m.

alanf commented 9 years ago

There's two ways to do this, one that's currently supported, the second will require editing a file.

First, if you create a file .formatting-directory, and that contains the directory of files you want to format, it will ignore everything except the directory you specify.

If your proto-generated files are not cordoned off in this way, it's a little more difficult.

The second way is, in spacecommander/lib/common-lib.sh, you can pipe the files in each of those two functions into grep -v pbobjc and this will filter out the generated files.

stevenle commented 9 years ago

Perfect, thank you!