rspec/rules/S4275/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

42 lines
555 B
Plaintext

== Why is this an issue?
include::description.adoc[]
=== Noncompliant code example
[source,text]
----
class A {
private int x;
private int y;
public void setX(int val) { // Noncompliant: field 'x' is not updated
this.y = val;
}
public int getY() { // Noncompliant: field 'y' is not used in the return value
return this.x;
}
}
----
=== Compliant solution
[source,text]
----
class A {
private int x;
private int y;
public void setX(int val) {
this.x = val;
}
public int getY() {
return this.y;
}
}
----