Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method names for event handlers S100

Tags:

c#

sonarqube

The Sonar rule csharpsquid:S100 (Method name should comply with a naming convention) is thrown also for event handlers that are generated by Visual Studio, something like:

protected void Page_Load(object sender, EventArgs e)
{
    DoIt();
}

Is it possible to ignore this rule for event handlers as they are auto-generated?

like image 427
Stephan Steiger Avatar asked Dec 03 '15 09:12

Stephan Steiger


1 Answers

We have already changed the default Regex for this rule to allow underscores. The next version of the C# plugin will use that. Until then you can change the Regex yourself to ^[A-Z][a-zA-Z0-9_]*[a-zA-Z0-9]$.

like image 172
Tamas Avatar answered Oct 21 '22 18:10

Tamas