We changed this behaviour a few weeks ago, it is now not necessary anymore to pass those parameters. PR analysis will be set up automatically when you run the sonar command without parameters in a CircleCI environment.
Usually the target branch of your PR will be a long-living branch on SonarCloud, and this branch will show all the issues it contains on SonarCloud. The PR will show all the issues that exist in the newly added/edited code. Would this cover your usecase?
To achieve this with CircleCI you would have to setup your build so that analysis gets triggered on every PR commit and on every commit on a regular branch. If analysis is triggered on a branch, and this branch
is the main branch or a long-living branch (see the docs), then it will show all the issues that exist in that branch. To set-up branch analysis you will also not have to pass any parameters to the sonar command.
In short just running the sonar-scanner command without any parameters on every commit should cover your described usecase.
Please let me know if this helps.
PS: we also have a CircleCI orb to simplify your