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

37 lines
794 B
Plaintext

== Why is this an issue?
Unlike class and instance methods, static methods don't receive an implicit first argument. Nonetheless naming the first argument ``++self++`` or ``++clz++`` guarantees confusion - either on the part of the original author, who may never understand why the arguments don't hold the values he expected, or on that of future maintainers.
=== Noncompliant code example
[source,python]
----
class MyClass:
@staticmethod
def s_meth(self, arg1, arg2): #Noncompliant
# ...
----
=== Compliant solution
[source,python]
----
class MyClass:
@staticmethod
def s_meth(arg1, arg2): #Noncompliant
# ...
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== duplicates: S2854
endif::env-github,rspecator-view[]