SonarLint for Visual Studio 1.8 發布
SonarSource 很高興的宣布 SonarLint for Visual Studio 1.8 版本發布。該版本嵌入 7 個新的 C# 規則,提升了其他的規則,同時修復了社區報告的一些 bug。
在 1.7 版本后新增的規則如下:
-
“==” should not be used when “Equals” is overridden
Example from project Akka:
commander
has an interface type, so==
will resolve to a reference equality check, but an implementation of that interface overridesobject.Equals
,
so there is a high chance that value equality should have been used. -
Parameters with “[DefaultParameterValue]” attributes should also be “[Optional]“
-
Optional parameters should have the same default value in overrides
此外改進了下列規則:
-
Methods with caller info attributes should not be invoked with explicit arguments does not report on cases when the passed value is also a parameter with caller info attribute.
-
Runtime type checking should be simplified now reports correctly on
IsAssignableFrom
calls. -
“Explicit” conversions of “foreach” loops should not be used only reports on
foreach
statements on generic collections. -
Culture should be specified for String operations now also handles
StringComparison
arguments. -
“IEnumerable” LINQs should be simplified doesn’t report false positives on
ToList()
calls.
詳情請看 release notes 或者訪問 SonarLint for Visual Studio site.
Have fun with SonarLint!
來自: http://www.oschina.net//news/70737/snoarlint-for-visual-studio-1-8