SonarLint analyze unwanted extensions files (.m matlab files)

Hi, the sonarlint extensions keeps analysing .m files which are matlab files, how I can disable analysis for specific extensions files?

I have set the .m extension to matlab in settings.json VSCode:

"files.associations": {
	"*.m": "matlab"
},
"[matlab]": {
	"files.encoding": "windows1252"
},

Thanks.

Hello @loic-lopez!

The reason why your *.m files got processed by SonarLint is that we detect languages based on file extensions, and .m extension is standard for Objective-C language. So this files are possible candidates for analysis.
But Objective-C language is disabled for SonarLint by default. So real analysis and displaying issues should be skipped in your case. Could you please elaborate more what is bothering you in SonarLint behaviour? Do you see any issues for this .m file?
I’d ask you post to this topic your SonarLint logs. You can see here how to get them. It will help to clarify what is happening.
Also will be great if you provide content of your sample .m file to reproduce the issue and the screenshot with unwanted SonarLint issues or messages you getting during your work with Matlab files.

Have a good day!

And if you want to disable processing of .m files more explicitly you can put following to your settings file:

"sonarlint.analyzerProperties": {
    "sonar.objc.file.suffixes": ".neverused"
}

It will override default Objective-C files extension from .m to .neverused and file will be skipped on earlier stage.

Hi @Kirill_Knize, thanks a lot !

In fact the SonarLint plugin processed .m matlab files as objc file.

Your solution by overriding objc file extension is working.

Best Regards,
Loïc Lopez

Would still be great to know what exactly wasn’t working though :grinning: