Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN: file not included in sonar /Users/Shared/work #21

Open
wyw1984 opened this issue Feb 17, 2022 · 9 comments
Open

WARN: file not included in sonar /Users/Shared/work #21

wyw1984 opened this issue Feb 17, 2022 · 9 comments

Comments

@wyw1984
Copy link

wyw1984 commented Feb 17, 2022

截屏2022-02-17 上午11 17 53

您好,当工程中有Pods文件时会报如图的警告 WARN: file not included in sonar /Users/Shared/work

sonarqube里也没有任何bug和异味,组件化后,我们的代码都在pods里,这个怎么解决呢?

@sydowma
Copy link
Collaborator

sydowma commented Feb 17, 2022

  1. 你要扫描的是 swift 语言?
  2. 贴一下执行 swiftlint 的命令
  3. 贴一下 执行扫描的命令

@wyw1984
Copy link
Author

wyw1984 commented Feb 17, 2022

1.是oc和swift混编
2.命令如下

#!/bin/bash

pod update

xcodebuild clean -workspace MyApp.xcworkspace -scheme MyApp -arch arm64 -configuration "Release"

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -arch arm64 -configuration "Release" GCC_PREPROCESSOR_DEFINITIONS="COCOAPODS=1" CODE_SIGN_STYLE="Manual" PROVISIONING_STYLE="Manual" DEVELOPMENT_TEAM="xxx" CODE_SIGN_IDENTITY="xxx" PROVISIONING_PROFILE="xxx" PROVISIONING_PROFILE_SPECIFIER="xxx" | xcpretty -r json-compilation-database -o compile_commands.json

rm -rf swiftlint

mkdir swiftlint

swiftlint lint > swiftlint/swiftlint.txt

sonar-scanner -Dsonar.host.url=http://10.155.59.201:9000/ -Dsonar.projectKey=MyApp -Dsonar.sources=. -Dsonar.swift.swiftlint.report=swiftlint/swiftlint.txt -Dsonar.login=admin -Dsonar.password=111111

@wyw1984
Copy link
Author

wyw1984 commented Feb 17, 2022

xcodebuild是成功了的,为了保密打包证书都替换成了xxx ,
如果只是swift语言 好像不用执行xcodebuild也一样能扫描
不过还是报同样的WARN: file not included in sonar

@sydowma
Copy link
Collaborator

sydowma commented Feb 17, 2022

  1. 如果只扫描 swift 不用执行 xcodebuild
  2. 如果需要扫描 OC ,请提前执行下 infer ,参考下文档的命令。
  3. 从你的结果来看,像是路径问题,你把 swiftlint.txt 放在当前目录下试试,去掉 swiftlint 这一层

@wyw1984
Copy link
Author

wyw1984 commented Feb 18, 2022

去掉了也不行,还是报WARN: file not included in sonar

@sydowma
Copy link
Collaborator

sydowma commented Feb 19, 2022

去掉了也不行,还是报WARN: file not included in sonar

执行 sonar-scanner 里加一个 -X,然后发一下 WARN: file not included in sonar 这个详细日志

@wyw1984
Copy link
Author

wyw1984 commented Feb 21, 2022

log.txt
您好 这是sonar-scanner 里加一个 -X后 jenkins上的log

@fndppx
Copy link

fndppx commented Apr 26, 2022

log.txt 您好 这是sonar-scanner 里加一个 -X后 jenkins上的log

解决了么,我也遇到这个问题了

@wuyanzu1-wyz
Copy link

hello,我也遇到了和楼主一样的问题,也是没有任何bug和异味,也出现了图中的警告,请问楼主解决了吗?是如何解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants