Fred Tingaud 51369b610e
Make sure that includes are always surrounded by empty lines (#2270)
When an include is not surrounded by empty lines, its content is inlined
on the same line as the adjacent content. That can lead to broken tags
and other display issues.
This PR fixes all such includes and introduces a validation step that
forbids introducing the same problem again.
2023-06-22 10:38:01 +02:00

24 lines
953 B
Plaintext

== Why is this an issue?
Certain https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/comparison-operators[mathematical comparisons] will always return the same value, and should not be performed.
Specifically, the following comparisons will return either always `true` or always `false` depending on the kind of comparison:
* comparing a `char` with a numeric constant that is outside of the range of `char`
* comparing a `float` with a numeric constant that is outside of the range of `float`
* comparing a `long` with a numeric constant that is outside of the range of `long`
* comparing a `ulong` with a numeric constant that is outside of the range of `ulong`
* etc.
=== Noncompliant code example
[source,csharp]
----
float f = 42.0f;
if (f <= double.MaxValue) { } // Noncompliant: always true
if (f > double.MaxValue) { } // Noncompliant: always false
----
include::../resources.adoc[]
include::../rspecator.adoc[]