
Co-authored-by: Fred Tingaud <95592999+frederic-tingaud-sonarsource@users.noreply.github.com>
56 lines
986 B
Plaintext
56 lines
986 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
Using the regular expression ``++^[_a-z][_a-z0-9]*$++``, the noncompliant code below:
|
|
|
|
[source,python,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
class MyClass:
|
|
myField = 1
|
|
----
|
|
|
|
Should be replaced with:
|
|
|
|
[source,python,diff-id=1,diff-type=compliant]
|
|
----
|
|
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[]
|