Question : Is it possible to change the rule’s error messages in settings.json?
Example :
“Rename this function to match the regular expression”
into
“Function name invalid, please change using proper format (e.g. secondary_function)”
It’s not in the SonarLint repo, but in the underlying language analyzer. Going back to your original post, I see we’re talking about C. That analyzer is closed source, and so not available for forking.
Regarding the specific message suggestion, we generally avoid using words like “invalid” in the message description, as they may lead to ambiguity and misinterpretation. For example, when we say the “name is invalid,” it is unclear if it does not abide by the C++ standard rules for identifiers (for example, using @ that is not in the basic character set or using `operator foo’) or if the issue is for not matching format. This is why we chose the current format.
Regarding the question, we currently do provide the ability to customize the rule message for configurable rules in the settings.json file. So this would be a new feature request for all the products. I will share your request with our product manager.