Objective-C 样式检查器:ocstyle

jopen 11年前

ocstyle 是一个用 Python 开发的 Objective-C 样式检查器。例如你有一个源码文件 test.m:

+(void) someMessage:(NSString*)subdomain {      NSString *ShouldStartLowerCase;      // ...  }
使用 ocstyle 检查的结果是:
$ ocstyle test.m  test.m  ERROR: 1:1 [1] - MissingSpace - Expected 1, got 0  ERROR: 1:8 [8] - ExtraSpace - Did not expect ' ' here  ERROR: 1:29 [29] - MissingSpace - Expected 1, got 0  ERROR: 1:41 [41] - MissingNewline - Should have newline after ;  ERROR: 1:41 [41] - MissingSemicolon - Expected a semicolon  ERROR: 2:35 [77] - BadLocalVariableName - Local variable must start with a lower case letter

项目主页:http://www.open-open.com/lib/view/home/1372555009362