# "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust # Allow replication connections from localhost, by a user with the # replication privilege. local replication all trust host replication all 127.0.0.1/32 trust host replication all ::1/128 trust
替换后
1 2 3 4 5 6 7 8 9 10 11 12 13
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 # Allow replication connections from localhost, by a user with the # replication privilege. local replication all md5 host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5
cat oclint.xml | sed "s#Switch Statements Should Have Default Rule#switch statements should have default#g" | sed "s#missing hash method#must override hash with isEqual#g" | sed "s#prefer early exits and continue#use early exits and continue#g" | sed "s#use boxed expression#replace with boxed expression#g" | sed "s#use container literal#replace with container literal#g" | sed "s#use number literal#replace with number literal#g" | sed "s#use object subscripting#replace with object subscripting#g" | sed "s#missing default in switch statements#switch statements should have default#g" | sed "s#unnecessary default statement in covered switch statement#switch statements don't need default when fully covered#g" | sed "s#covered switch statements dont need default#switch statements don't need default when fully covered#g" > sonar-reports/oclint.xml /bin/sh sonar-scanner -X
sonar.projectKey=你的项目Key sonar.projectName=项目名 sonar.projectVersion=版本号 sonar.language=objc # Project description sonar.projectDescription=Text sonarquebe # Path to source directories sonar.sources=项目源码文件夹名称 # Path to test directories (comment if no test) # sonar.tests=testSrcDir # Xcode project configuration (.xcodeproj or .xcworkspace) # -> If you have a project: configure only sonar.objectivec.project # -> If you have a workspace: configure sonar.objectivec.workspace and sonar.objectivec.project # and use the later to specify which project(s) to include in the analysis (comma separated list) sonar.objectivec.project=项目名.xcodeproj # sonar.objectivec.workspace=myApplication.xcworkspace # Scheme to build your application sonar.objectivec.appScheme=需要编译的Scheme名 # Scheme to build and run your tests (comment following line of you don't have any tests) # sonar.objectivec.testScheme=myApplicationTests ########################## # Optional configuration # ########################## # Encoding of the source code sonar.sourceEncoding=UTF-8 # JUnit report generated by run-sonar.sh is stored in sonar-reports/TEST-report.xml # Change it only if you generate the file on your own # The XML files have to be prefixed by TEST- otherwise they are not processed # sonar.junit.reportsPath=sonar-reports/ # Cobertura report generated by run-sonar.sh is stored in sonar-reports/coverage.xml # Change it only if you generate the file on your own sonar.objectivec.coverage.reportPattern=sonar-reports/coverage*.xml # OCLint report generated by run-sonar.sh is stored in sonar-reports/oclint.xml # Change it only if you generate the file on your own sonar.objectivec.oclint.report=oclint.xml sonar.objectivec.oclint.reportPath=sonar-reports/oclint.xml # Paths to exclude from coverage report (tests, 3rd party libraries etc.) # sonar.objectivec.excludedPathsFromCoverage=pattern1,pattern2 sonar.objectivec.excludedPathsFromCoverage=.*Tests.* # Project SCM settings # sonar.scm.enabled=true # sonar.scm.url=scm:git:https://...
输入wq命令保存并退出。
为避免编译的时候出现oclint: error: one compiler command contains multiple jobs:的报错,需要使用XCode打开工程文件并且在Build Settings中将COMPILER_INDEX_STORE_ENABLE设置为NO。