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

Output FilesToAnalyze.txt as utf-8 #1037

Closed
NatMarchand opened this issue Jul 19, 2021 · 3 comments · Fixed by #1043
Closed

Output FilesToAnalyze.txt as utf-8 #1037

NatMarchand opened this issue Jul 19, 2021 · 3 comments · Fixed by #1043
Assignees
Milestone

Comments

@NatMarchand
Copy link
Contributor

Hi,
I'm currently encountering issues as I need to do a sed to replace paths in FilesToAnalyze.txt files as those files are utf-16le encoded.

Can you change them to utf-8 ? Just removing Encoding parameters in the file should do the trick as default value is utf-8.
Thanks !

@pavel-mikula-sonarsource
Copy link
Contributor

The explicit argument would be preferred. We need whatever will produce UTF-8 with BOM

@duncanp-sonar
Copy link
Contributor

duncanp-sonar commented Aug 10, 2021

@NatMarchand FilesToAnalyze.txt is generated and consumed by the scanner i.e. it's an implementation detail that could change.

Why do you need to modify the contents of the file? Is it to work round a bug, or is there a new feature you'd like the scanner to support?

cc @tom-howlett-sonarsource

@NatMarchand
Copy link
Contributor Author

NatMarchand commented Aug 11, 2021

I'm currently using sonarqube with gitlab and in our pipeline, starting the analysis, running tests and completing analysis are on different jobs. When the repo is cloned, there's a random string in the path (which is the id of the provisioned runner) which makes the path not the same accross all the jobs. Therefore, as all paths are absolute, I need to rewrite and change the base path.
Something like that:

    - find results/ -type f -name "coverage.opencover.xml" -exec sed -i "s /src ${CI_PROJECT_DIR} gI" {} \;
    - find .sonarqube/ -type f -exec sed -i "s /builds/.*/${CI_PROJECT_PATH} ${CI_PROJECT_DIR} gI" {} \;
    - find . -type f -name "*.RoslynCA.json" -exec sed -i "s /builds/.*/${CI_PROJECT_PATH} ${CI_PROJECT_DIR} gI" {} \;
    - dotnet-sonarscanner end -d:sonar.login="${SONAR_TOKEN}"

@pavel-mikula-sonarsource pavel-mikula-sonarsource moved this from To do to Review in progress in S4NET Kanban Aug 13, 2021
@pavel-mikula-sonarsource pavel-mikula-sonarsource moved this from Review in progress to To do in S4NET Kanban Aug 13, 2021
@pavel-mikula-sonarsource pavel-mikula-sonarsource moved this from To do to Done in S4NET Kanban Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
S4NET Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants