ocstyle - Objective-C 样式检查器


Apache
跨平台
Python

软件简介

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