diff options
author | Thomas Wiest <twiest@redhat.com> | 2015-06-24 10:48:11 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@redhat.com> | 2015-06-24 10:49:08 -0400 |
commit | feed0b5595bb65b553459b6c6c256de51a4c4276 (patch) | |
tree | 42e7eb629cae70ebc42a4eb0b6c3929e8a38395a | |
parent | 578120137601c060805bcdcea13730573a8a3755 (diff) | |
download | openshift-feed0b5595bb65b553459b6c6c256de51a4c4276.tar.gz openshift-feed0b5595bb65b553459b6c6c256de51a4c4276.tar.bz2 openshift-feed0b5595bb65b553459b6c6c256de51a4c4276.tar.xz openshift-feed0b5595bb65b553459b6c6c256de51a4c4276.zip |
added python new method params should use a default value to best practices guide.
-rw-r--r-- | docs/best_practices_guide.adoc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/best_practices_guide.adoc b/docs/best_practices_guide.adoc index 912617461..1e96655e1 100644 --- a/docs/best_practices_guide.adoc +++ b/docs/best_practices_guide.adoc @@ -27,6 +27,32 @@ The tooling is flexible enough that exceptions can be made so that the tool the == Python +=== Method Signatures + +''' +[cols="2v,v"] +|=== +| **Rule** +| When adding a new paramemter to an existing method, a default value SHOULD be used +|=== +The purpose of this rule is to make it so that method signatures are backwards compatible. + +If this rule isn't followed, it will be necessary for the person who changed the method to search out all callers and make sure that they're able to use the new method signature. + +Example: +.Before: +[source,python] +---- +def add_person(first_name, last_name): +---- + +.After: +[source,python] +---- +def add_person(first_name, last_name, age=None): +---- + + === PyLint http://www.pylint.org/[PyLint] is used in an attempt to keep the python code as clean and as managable as possible. The build bot runs each pull request through PyLint and any warnings or errors cause the build bot to fail the pull request. |