Ignoring files seems not to work

Hi,

I have create a lot different source file exclusions, but all does not seem to work for a Pull Request to start with. So the screendumps below. The first one with the exclude path settings:

And second picture with the SonarCloud information at our Pull Request

The file “20240606113815_AddTableFunctionResult.cs” is a automatic generated file and should not be scanned by SonarCloud. In fact all the files in the folder Migrations should not be scanned by SonarCloud.

But now the question is: What are we doing wrong?

Who can help me to solve my problem?

Hey there.

Probably this can be simplified to **/Migrations/** then.

In any case, it’s probably time to check your scanner logs to make sure the expected values are being considered for analysis, and not being overridden (if you have sonar.exclusions set at the command line or in another local settings file, they’ll override whatever is in the UI).

You can check the scanner logs:

INFO: Project configuration:
INFO:   Excluded sources: **/Migrations/**

Good tip! We were using a variable in the command-line … that was the reason it didn’t work.

Does this also apply for Ignoring blocks within files, because this also does not work in our case.

But in the Sonar logs there is no key sonar.issue.ignore.block found. So the block exclusion doesn’t work.

Hey there.

I’m not connecting the dots between Excluding Sources and Ignoring Issues in files… can you help me out?

If you’re facing a new issue with Ignoring Issues in Blocks, I would suggest raising a new thread with a code sample :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.