2

我正在寻找有关如何配置 OCLint 或如何使其运行的示例。我进行了搜索,但没有。在 Stack Overflow 上只有 3 个相关的帖子,只是命名库,在谷歌上只有官方的OCLint.org

官方文档说:

[user@localhost ~]$ oclint -help
OVERVIEW: OCLint, a static code analysis tool for Objective-C and related languages

USAGE: oclint [options] <input files>

OPTIONS:
  -D <macro>               - Predefine the specified macro
  -F <directory>           - Add directory to framework include search path
  -I <directory>           - Add directory to include search path
  -R <directory>           - Add directory to rule loading path
  -arch <arch_name>        - Specify which architecture (e.g. ppc, i386, x86_64, armv7) the compilation 
                             should targets.
  -help                    - Display available options (-help-hidden for more)
  -include <file>          - Include file before parsing
  -isysroot <directory>    - Add directory to SYSTEM include search path
  -o <file>                - Write output to <file>
  -rc <paramemter>=<value> - Change the baheviour of rules
  -stats                   - Enable statistics output from program
  Choose report type:
    -text                  - Plain text report
    -html                  - HTML formatted report
  -version                 - Display the version of this program
  -x <value>               - Input language type

但我想更好地解释宏 (-D),以及为 -I、-F、-R 选择哪条路径以及我应该指出什么。代码示例为

$ oclint path/to/file.m -D something -I something -F something -R something

并且预期的输出将是巨大的。

4

1 回答 1

1

基本上,您只需将oclint您提供给编译器的任何内容都提供给您。

oclint-xcodebuild或者,如果您不熟悉编译器标志,您可能想尝试一下。这是一个从 Xcode 构建日志文件中提取标志的 Python 脚本。请参阅此处的用法。

于 2013-01-11T23:27:53.710 回答