文章

OCLint学习使用

安装xcpretty碰到

1
2
3
4
5
6
7
demo|dev ⇒ gem install xcpretty
ERROR:  Loading command: install (LoadError)
	dlopen(/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin16/openssl.bundle
  Reason: image not found - /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin16/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

解决方案,dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

1
2
brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl

之后就能成功gem install xcpretty

xcodebuild扫描生成的compile_commands.json文件过大,oclint-json-compilation-database会提示出错“OSError: [Errno 7] Argument list too long”,

OCLint 实现 Code Review - 给你的代码提提质量跟着这边文章,能跑成demo,但是跑项目,有问题

  1. xcodebuild生成compile_commands.json有 100m,太大了,执行oclint-json-compilation-database会提示出错“OSError: [Errno 7] Argument list too long”

    参考使用解决方案

  2. 注释了1中的提供的py的部分代码,只将json拆小之后,生成四个compile_commands.json文件,然后执行oclint-json-compilation-database

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    if __name__ == "__main__":
        if len(sys.argv) < 2:
            print "Missing argument!"
        else:
       
            with open(sys.argv[1], 'r') as r_handler:
                json_objects = json.loads(r_handler.read())
            if len(json_objects) <= maxCountPerFile:
                lint('oclint.xml')
            else:
                json_file = rename(sys.argv[1], 'input.json')
                json_files = split_json(json_objects)
                # xml_files = lint_jsonfiles(json_files)
                # combine_outputs(xml_files)
                # for xml_file in xml_files:
                #     os.remove(xml_file)
                # rename(json_file, 'compile_commands.json')
    

    出现文中说的oclint: error: one compiler command contains multiple jobs,按照修改之后,podfile部分的修改之后podinstall,依旧报错

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    demo|dev⚡ ⇒ pod install
       
    [!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..
       
     #  from /Users/rambo/demo/Podfile:113
     #  -------------------------------------------
     #
     >  post_install do |installer|
     #    installer.pods_project.targets.each do |target|
     #  -------------------------------------------
    

infer

简述 LLVM 与 Clang 及其关系

本文由作者按照 CC BY 4.0 进行授权