
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.
30 lines
831 B
Plaintext
30 lines
831 B
Plaintext
== Why is this an issue?
|
|
|
|
There are no constants in Python, but when a variable is named with all uppercase letters, the convention is to treat it as a constant. I.e. to use it as a read-only variable, and not reassign its value.
|
|
|
|
|
|
Ignore this convention, and you run the risk of confusing other developers, particularly those with experience in other languages. This rule raises an issue each time a variable named with all uppercase letters is reassigned.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
RESOURCE_NAME = 'foo'
|
|
# ...
|
|
RESOURCE_NAME = 'bar' # Noncompliant
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
The naming of "xxx" indicates that it is intended to be constant, and should not be reassigned.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|