Skip to content

Commit

Permalink
fix(python): parameter names in docstrings should be snake_case, not …
Browse files Browse the repository at this point in the history
…camelCase (#539)
  • Loading branch information
garnaat authored and Elad Ben-Israel committed Jun 24, 2019
1 parent 8c826c1 commit a91a315
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ function emitDocString(code: CodeMaker, docs: spec.Docs | undefined, options: {
for (const param of options.arguments) {
// Add a line for every argument. Even if there is no description, we need
// the docstring so that the Sphinx extension can add the type annotations.
lines.push(` ${param.name}: ${onelineDescription(param.docs)}`);
lines.push(` ${toPythonParameterName(param.name)}: ${onelineDescription(param.docs)}`);
}
brk();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def get_foo(self, with_param: str) -> str:
"""getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay.
Arguments:
withParam: -
with_param: -
Stability:
experimental
Expand Down Expand Up @@ -869,8 +869,8 @@ class DeprecatedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DeprecatedCl
def __init__(self, readonly_string: str, mutable_number: typing.Optional[jsii.Number]=None) -> None:
"""
Arguments:
readonlyString: -
mutableNumber: -
readonly_string: -
mutable_number: -
Deprecated:
this constructor is "just" okay
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def __init__(self) -> None:
def change_private_property_value(self, new_value: str) -> None:
"""
Arguments:
newValue: -
new_value: -
Stability:
experimental
Expand Down Expand Up @@ -1091,9 +1091,9 @@ def __init__(self) -> None:
def method(self, _required_any: typing.Any, _optional_any: typing.Any=None, _optional_string: typing.Optional[str]=None) -> None:
"""
Arguments:
_requiredAny: -
_optionalAny: -
_optionalString: -
_required_any: -
_optional_any: -
_optional_string: -
Stability:
experimental
Expand Down Expand Up @@ -1242,8 +1242,8 @@ class ExperimentalClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Experiment
def __init__(self, readonly_string: str, mutable_number: typing.Optional[jsii.Number]=None) -> None:
"""
Arguments:
readonlyString: -
mutableNumber: -
readonly_string: -
mutable_number: -
Stability:
experimental
Expand Down Expand Up @@ -1367,15 +1367,15 @@ def derived_to_first(self, *, another_required: datetime.datetime, bool: bool, n
Arguments:
derived: -
anotherRequired:
another_required:
bool:
nonPrimitive: An example of a non primitive property.
anotherOptional: This is optional.
optionalAny:
optionalArray:
non_primitive: An example of a non primitive property.
another_optional: This is optional.
optional_any:
optional_array:
anumber: An awesome number value.
astring: A string value.
firstOptional:
first_optional:
Stability:
experimental
Expand All @@ -1402,15 +1402,15 @@ def read_derived_non_primitive(self, *, another_required: datetime.datetime, boo
Arguments:
derived: -
anotherRequired:
another_required:
bool:
nonPrimitive: An example of a non primitive property.
anotherOptional: This is optional.
optionalAny:
optionalArray:
non_primitive: An example of a non primitive property.
another_optional: This is optional.
optional_any:
optional_array:
anumber: An awesome number value.
astring: A string value.
firstOptional:
first_optional:
Stability:
experimental
Expand Down Expand Up @@ -1439,7 +1439,7 @@ def read_first_number(self, *, anumber: jsii.Number, astring: str, first_optiona
first: -
anumber: An awesome number value.
astring: A string value.
firstOptional:
first_optional:
Stability:
experimental
Expand Down Expand Up @@ -2140,8 +2140,8 @@ class ClassWithPrivateConstructorAndAutomaticProperties(metaclass=jsii.JSIIMeta,
def create(cls, read_only_string: str, read_write_string: str) -> "ClassWithPrivateConstructorAndAutomaticProperties":
"""
Arguments:
readOnlyString: -
readWriteString: -
read_only_string: -
read_write_string: -
Stability:
experimental
Expand Down Expand Up @@ -3936,8 +3936,8 @@ def give_me_undefined_inside_an_object(self, *, array_with_three_elements_and_un
"""
Arguments:
input: -
arrayWithThreeElementsAndUndefinedAsSecondArgument:
thisShouldBeUndefined:
array_with_three_elements_and_undefined_as_second_argument:
this_should_be_undefined:
Stability:
experimental
Expand Down Expand Up @@ -4161,7 +4161,7 @@ class OptionalStructConsumer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Optio
def __init__(self, *, field: typing.Optional[str]=None) -> None:
"""
Arguments:
optionalStruct: -
optional_struct: -
field:
Stability:
Expand Down Expand Up @@ -4794,8 +4794,8 @@ class StableClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StableClass"):
def __init__(self, readonly_string: str, mutable_number: typing.Optional[jsii.Number]=None) -> None:
"""
Arguments:
readonlyString: -
mutableNumber: -
readonly_string: -
mutable_number: -
Stability:
stable
Expand Down Expand Up @@ -5603,7 +5603,7 @@ class WithPrivatePropertyInConstructor(metaclass=jsii.JSIIMeta, jsii_type="jsii-
def __init__(self, private_field: typing.Optional[str]=None) -> None:
"""
Arguments:
privateField: -
private_field: -
Stability:
experimental
Expand Down Expand Up @@ -5751,8 +5751,8 @@ def __init__(self, *, initial_value: typing.Optional[jsii.Number]=None, maximum_
Arguments:
props: Initialization properties.
initialValue:
maximumValue:
initial_value:
maximum_value:
Stability:
experimental
Expand Down

0 comments on commit a91a315

Please sign in to comment.