OGeek|极客世界-中国程序员成长平台

标题: iOS : OCLint is not working with xcode 9. 2 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:42
标题: iOS : OCLint is not working with xcode 9. 2

我们已将 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

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

它似乎可以在旧 XCodes 上正常工作,但不能在 XCode 9.2 上工作。

谁能告诉我们在 xcode 9.2 中完美运行 OCLint 需要哪些更改?

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

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



Best Answer-推荐答案


几天前,当我们使用 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/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4