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
820 B
Plaintext

== Why is this an issue?
During dictionary use, it is normal that you might want to replace the value associated with one of the dictionary's keys. But do so during the initial definition of a dictionary, and you've probably made an error.
This rule raises an issue when the same key is used multiple times in the initial definition of a dictionary.
=== Noncompliant code example
[source,python]
----
fruit = {"apple":4, "pear":6, "quince":29, "apple": 8} # Noncompliant; "apple" is used in positions 0 and 3
----
=== Compliant solution
[source,python]
----
fruit = {"apple":4, "pear":6, "quince":29, "potato": 8}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
"xxx" is used in positions n, o, p...
endif::env-github,rspecator-view[]