Skip to content

Commit d42ca61

Browse files
author
takuya_sekiguchi
committed
#17 Fix argument default value's quotation bug.
1 parent 2b3829e commit d42ca61

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

numdoclint/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
check_python_module,
1818
check_python_module_recursively)
1919

20-
__version__ = '0.1.1'
20+
__version__ = '0.1.2'

numdoclint/helper.py

-2
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,6 @@ def get_arg_default_val_info_dict(py_module_str, func_name):
815815
default_val_info_dict = {}
816816
for arg_str in splitted_arg_list:
817817
arg_str = arg_str.replace(' ', '')
818-
arg_str = arg_str.replace("'", '')
819-
arg_str = arg_str.replace('"', '')
820818
arg_str = _remove_type_str_from_arg_str(arg_str=arg_str)
821819
default_val_exists = '=' in arg_str
822820
if not default_val_exists:

tests/test_helper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -825,14 +825,14 @@ def sample_func_6(dict_value: Optional[Dict[str, int]] = None) -> str:
825825
py_module_str=py_module_str, func_name='sample_func_4')
826826
expected_dict = {
827827
'price': '100',
828-
'name': 'apple',
828+
'name': "'apple'",
829829
}
830830
assert default_val_info_dict == expected_dict
831831

832832
default_val_info_dict = helper.get_arg_default_val_info_dict(
833833
py_module_str=py_module_str, func_name='sample_func_5')
834834
expected_dict = {
835-
'name': 'apple',
835+
'name': '"apple"',
836836
}
837837
assert default_val_info_dict == expected_dict
838838

0 commit comments

Comments
 (0)