rspec/rules/S122/csharp/rule.adoc

48 lines
807 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 10:16:44 +02:00
include::../description.adoc[]
=== Noncompliant code example
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 10:16:44 +02:00
----
if(someCondition) DoSomething();
----
=== Compliant solution
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 10:16:44 +02:00
----
if(someCondition)
{
DoSomething();
}
----
=== Exceptions
2020-06-30 10:16:44 +02:00
Anonymous functions containing a single statement are ignored. Block statements are not considered either.
2021-02-02 15:02:10 +01:00
2020-06-30 10:16:44 +02:00
----
Func<object, bool> item1 = o => { return true; }; // Compliant
Func<object, bool> item1 = o => { var r = false; return r; }; // Noncompliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]