I want code quality checks to be done only in CI pipeline, not in dev environment
We are using Container (Docker) projects in Visual Studio to have consistent environment in dev and prod. So we are not interested in code quality checks until PR is ready
Seems like you are suggesting conditional sonarscanner in Dockerfile (option 2)
Is there some default env variable to turn off sonarscanner? To avoid wrapping it everywhere in Dockerfile like this
RUN if [ "$SONAR_ENABLED" = "true" ]; then \
dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"; \
fi
There is also third option - having two different Dockerfiles (one for CI and one for local runs), but it introduces maintenance and sync issues