iOS : OCLint is not working with xcode 9. 2

标签 ios objective-c xcode oclint

我们使用以下脚本将 OCLint 集成到我们的一个项目中。

source ~/.bash_profile
export PATH=$PATH:/usr/local/bin/

if [ -z "${SCHEME+x}" ]
then
export SCHEME="${PROJECT_NAME}"
fi

if [ -z "${WORKSPACE+x}" ]
then
export WORKSPACE="${PROJECT_NAME}.xcworkspace"
fi

cd "${SOURCE_ROOT}"

# Check if xctool and oclint are installed
if ! which -s xctool
then
echo 'error: xctool not found, install e.g. with homebrew'
exit 1
fi

if ! which -s oclint-json-compilation-database
then
echo 'error: OCLint not installed, install e.g. with homebrew cask'
exit 2
fi

# Cleanup before building
rm -f compile_commands.json
xctool -workspace "${WORKSPACE}" -scheme "${SCHEME}" clean > /dev/null

# Build and analyze
# OCLint Rule Index: http://docs.oclint.org/en/dev/rules/index.html
xctool -workspace "${WORKSPACE}" -scheme "${SCHEME}" -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database -e Pods -- -max-priority-1=100000 -max-priority-2=100000 -max-priority-3=100000 \

# Final cleanup
rm -f compile_commands.json

尽管代码包含大量警告和错误,但它给出“零”警告和“零”错误。

它似乎在旧的 XCode 上运行良好,但在 XCode 9.2 上运行不佳。

谁能告诉我们要在 xcode 9.2 中完美运行 OCLint 需要什么样的更改?

我们期望 xcode 在我们构建 OCLint 模式时显示警告。但我们现在没有得到任何结果。

如果我们做错了什么,请指导我们。

最佳答案

几天前,当我们使用 oclint 0.11 从 xcode 8.2.1 升级到 xcode 9.2 时,我们遇到了类似的挑战 您能否尝试升级到 oclint-0.13.1 并重试,看看是否有帮助。

还有一些其他调整,但不确定是否适合?

https://github.com/oclint/oclint/issues/245 (搜索 -fmodules 和 -gmodules 的文本,并删除所有匹配项。)

https://github.com/oclint/oclint/issues/302 (设置 CLANG_ENABLE_MODULE_DEBUGGING=NO)

关于iOS : OCLint is not working with xcode 9. 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48581395/

相关文章:

ios - 动画视觉格式语言约束

ios - 如何在 swift 4 中使用 UIImagePickerController

javascript - ios - 如何从 objective-c 更改 .html 文件中的字符串并更新 webview?

ios - 如何从url中提取图片

ios - swift 3 : Joining multiple Strings with "+" operator no longer possible

swift - 无法在 Mojave 上安装 jazzy

ios - 如何在 HealthKit 中获取 HKWorkoutActivityType 的名称?

html - 如何使用 metatag 在 ios 设备的移动网站上禁用缩放?

objective-c - 关闭 2 个模态视图 Controller

xcode - 如何在 Xcode Story Board 中添加关于多设备的动态字体大小