rspec/rules/S116/python/rule.adoc

56 lines
986 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 10:16:44 +02:00
include::../description.adoc[]
Using the regular expression ``++^[_a-z][_a-z0-9]*$++``, the noncompliant code below:
2020-06-30 10:16:44 +02:00
[source,python,diff-id=1,diff-type=noncompliant]
2020-06-30 10:16:44 +02:00
----
class MyClass:
myField = 1
----
Should be replaced with:
2020-06-30 10:16:44 +02:00
[source,python,diff-id=1,diff-type=compliant]
2020-06-30 10:16:44 +02:00
----
class MyClass:
my_field = 1
----
== Resources
=== Documentation
* Python Enhancement Proposals - https://peps.python.org/pep-0008/#naming-conventions[PEP8 - Naming Conventions]
* Wikipedia - https://en.wikipedia.org/wiki/Naming_convention_(programming)[Naming Convention (programming)]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
=== Parameters
.format
****
----
^[_a-z][_a-z0-9]*$
----
Regular expression used to check the field names against.
****
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]