rspec/rules/S2772/python/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

48 lines
874 B
Plaintext

== Why is this an issue?
The use of a ``++pass++`` statement where it's not required by the syntax is pure cruft and should be removed.
=== Noncompliant code example
[source,python]
----
def __init__(self, log="", who="", date=0, files=[]):
self.log = log
self.files = files
self.who = who
self.date = date
pass # Noncompliant
def lookup():
pass # Compliant; method can't be empty
----
=== Compliant solution
[source,python]
----
def __init__(self, log="", who="", date=0, files=[]):
self.log = log
self.files = files
self.who = who
self.date = date
def lookup():
pass
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this unneeded "pass".
endif::env-github,rspecator-view[]