Skip to content

Commit 067cc7d

Browse files
committed
Fix word mistake (#14).
1 parent 8aecc9b commit 067cc7d

10 files changed

Lines changed: 109 additions & 109 deletions

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ If you only need lint result list, and not necessary standard output, then set v
136136

137137
### Ignore specified functions
138138

139-
If you want to skip functions with a specific suffix, set suffix names to the `skip_decorator_name_list` argument (default is `[test_]`).
139+
If you want to skip functions with a specific prefix, set prefix names to the `skip_decorator_name_list` argument (default is `[test_]`).
140140

141141
```py
142142
>>> lint_info_list = numdoclint.check_python_module(
143143
... py_module_path='../pandas/pandas/core/arrays/array_.py',
144-
... ignore_func_name_suffix_list=['test_', '_main', '__init__'])
144+
... ignore_func_name_prefix_list=['test_', '_main', '__init__'])
145145
```
146146

147147
### Ignore specified IDs check
@@ -244,7 +244,7 @@ check_result_list = numdoclint.check_jupyter_notebook_recursively(
244244
dir_path='./sample_dir/')
245245
```
246246

247-
`ignore_func_name_suffix_list`, `ignore_info_id_list`, and `enable_default_or_optional_doc_check` arguments described above are also available.
247+
`ignore_func_name_prefix_list`, `ignore_info_id_list`, and `enable_default_or_optional_doc_check` arguments described above are also available.
248248

249249
## Command line interface
250250

@@ -266,8 +266,8 @@ The following arguments are provided. Only `--path` argument is required, other
266266
argument.
267267
-j, --is_jupyter If specified, check target will become Jupyter
268268
notebook. If not, Python module will be checked.
269-
-f IGNORE_FUNC_NAME_SUFFIX_LIST, --ignore_func_name_suffix_list IGNORE_FUNC_NAME_SUFFIX_LIST
270-
A suffix list of function name conditions to ignore.
269+
-f IGNORE_FUNC_NAME_PREFIX_LIST, --ignore_func_name_prefix_list IGNORE_FUNC_NAME_PREFIX_LIST
270+
A prefix list of function name conditions to ignore.
271271
e.g., test_,sample_. Comma separated string is
272272
acceptable.
273273
-i IGNORE_INFO_ID_LIST, --ignore_info_id_list IGNORE_INFO_ID_LIST

numdoclint/__init__.py

Lines changed: 1 addition & 1 deletion
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.0.11'
20+
__version__ = '0.0.12'

numdoclint/cli.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _exec_numdoclint(
9494
path,
9595
check_recursively,
9696
is_jupyter,
97-
ignore_func_name_suffix_list,
97+
ignore_func_name_prefix_list,
9898
ignore_info_id_list,
9999
enable_default_or_optional_doc_check,
100100
skip_decorator_name_list):
@@ -111,8 +111,8 @@ def _exec_numdoclint(
111111
is_jupyter : bool
112112
If True, check target will become Jupyter notebook.
113113
If not, Python module will be checked.
114-
ignore_func_name_suffix_list : list of str
115-
A suffix list of function name conditions to ignore.
114+
ignore_func_name_prefix_list : list of str
115+
A prefix list of function name conditions to ignore.
116116
ignore_info_id_list : list of int
117117
List of IDs to ignore lint checking.
118118
enable_default_or_optional_doc_check : bool
@@ -132,14 +132,14 @@ def _exec_numdoclint(
132132
if not check_recursively:
133133
info_list = numdoclint.check_python_module(
134134
py_module_path=path,
135-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
135+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
136136
ignore_info_id_list=ignore_info_id_list,
137137
enable_default_or_optional_doc_check=enable_def_or_opt_check,
138138
skip_decorator_name_list=skip_decorator_name_list)
139139
return info_list
140140
info_list = numdoclint.check_python_module_recursively(
141141
dir_path=path,
142-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
142+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
143143
ignore_info_id_list=ignore_info_id_list,
144144
enable_default_or_optional_doc_check=enable_def_or_opt_check,
145145
skip_decorator_name_list=skip_decorator_name_list)
@@ -148,13 +148,13 @@ def _exec_numdoclint(
148148
if not check_recursively:
149149
info_list = numdoclint.check_jupyter_notebook(
150150
notebook_path=path,
151-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
151+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
152152
ignore_info_id_list=ignore_info_id_list,
153153
enable_default_or_optional_doc_check=enable_def_or_opt_check)
154154
return info_list
155155
info_list = numdoclint.check_jupyter_notebook_recursively(
156156
dir_path=path,
157-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
157+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
158158
ignore_info_id_list=ignore_info_id_list,
159159
enable_default_or_optional_doc_check=enable_def_or_opt_check)
160160
return info_list
@@ -197,10 +197,10 @@ def main(args=None, return_list=False):
197197
help='If specified, check target will become Jupyter notebook. '
198198
'If not, Python module will be checked.')
199199
parser.add_argument(
200-
'-f', '--ignore_func_name_suffix_list',
200+
'-f', '--ignore_func_name_prefix_list',
201201
type=_get_list_of_str_from_csv,
202202
default='',
203-
help='A suffix list of function name conditions to ignore.'
203+
help='A prefix list of function name conditions to ignore.'
204204
'\ne.g., test_,sample_.'
205205
'\nComma separated string is acceptable.')
206206
parser.add_argument(
@@ -238,7 +238,7 @@ def main(args=None, return_list=False):
238238
path=args.path,
239239
check_recursively=args.check_recursively,
240240
is_jupyter=args.is_jupyter,
241-
ignore_func_name_suffix_list=args.ignore_func_name_suffix_list,
241+
ignore_func_name_prefix_list=args.ignore_func_name_prefix_list,
242242
ignore_info_id_list=args.ignore_info_id_list,
243243
enable_default_or_optional_doc_check=enable_def_or_opt_check,
244244
skip_decorator_name_list=args.skip_decorator_name_list,

numdoclint/helper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
]
1717
ARG_NAME_LIST_TO_IGNORE.extend(ARGS_OR_KWARGS_NAME_LIST)
1818

19-
ADDITIONAL_INFO_SUFFIX_LIST = [
19+
ADDITIONAL_INFO_PREFIX_LIST = [
2020
'.. versionadded',
2121
'.. deprecated',
2222
'.. versionchanged',
@@ -912,8 +912,8 @@ def _is_additional_info_str(target_str):
912912
will be set.
913913
"""
914914
target_str = target_str.strip()
915-
for additional_info_suffix in ADDITIONAL_INFO_SUFFIX_LIST:
916-
if target_str.startswith(additional_info_suffix):
915+
for additional_info_prefix in ADDITIONAL_INFO_PREFIX_LIST:
916+
if target_str.startswith(additional_info_prefix):
917917
return True
918918
return False
919919

@@ -1053,11 +1053,11 @@ def _get_return_value_docstring(docstring, drop_additional_info=True):
10531053
docstring = docstring.strip()
10541054

10551055
if drop_additional_info:
1056-
for additional_info_suffix in ADDITIONAL_INFO_SUFFIX_LIST:
1057-
is_in = additional_info_suffix in docstring
1056+
for additional_info_prefix in ADDITIONAL_INFO_PREFIX_LIST:
1057+
is_in = additional_info_prefix in docstring
10581058
if not is_in:
10591059
continue
1060-
docstring = docstring.split(additional_info_suffix)[0]
1060+
docstring = docstring.split(additional_info_prefix)[0]
10611061
docstring = docstring.strip()
10621062

10631063
if not docstring.startswith(' '):

numdoclint/jupyter_notebook.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def check_jupyter_notebook(
22-
notebook_path, verbose=1, ignore_func_name_suffix_list=['test_'],
22+
notebook_path, verbose=1, ignore_func_name_prefix_list=['test_'],
2323
ignore_info_id_list=[],
2424
enable_default_or_optional_doc_check=False):
2525
"""
@@ -33,11 +33,11 @@ def check_jupyter_notebook(
3333
Log settings of stdout. Specify one of the following numbers:
3434
- 0 -> Do not output log.
3535
- 1 -> Output the check result.
36-
ignore_func_name_suffix_list : list of str, default ['test_']
37-
A suffix list of function name conditions to ignore.
36+
ignore_func_name_prefix_list : list of str, default ['test_']
37+
A prefix list of function name conditions to ignore.
3838
ignore_info_id_list : list of int, default []
3939
List of IDs to ignore lint checking. A constant with a
40-
suffix of `INFO_ID_` can be specified.
40+
prefix of `INFO_ID_` can be specified.
4141
enable_default_or_optional_doc_check : bool, default False
4242
If True specified, the `default` and `optional` string
4343
in docstring will be checked.
@@ -82,7 +82,7 @@ def check_jupyter_notebook(
8282
notebook_path=notebook_path,
8383
code_cell_idx=i,
8484
code_cell_str=code_cell_str,
85-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
85+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
8686
ignore_info_id_list=ignore_info_id_list,
8787
enable_default_or_optional_doc_check=enable_def_or_opt_check)
8888
info_list.extend(info_list_unit)
@@ -91,7 +91,7 @@ def check_jupyter_notebook(
9191

9292

9393
def check_jupyter_notebook_recursively(
94-
dir_path, verbose=1, ignore_func_name_suffix_list=['test_'],
94+
dir_path, verbose=1, ignore_func_name_prefix_list=['test_'],
9595
ignore_info_id_list=[],
9696
enable_default_or_optional_doc_check=False):
9797
"""
@@ -105,11 +105,11 @@ def check_jupyter_notebook_recursively(
105105
Log settings of stdout. Specify one of the following numbers:
106106
- 0 -> Do not output log.
107107
- 1 -> Output the check result.
108-
ignore_func_name_suffix_list : list of str, default ['test_']
109-
A suffix list of function name conditions to ignore.
108+
ignore_func_name_prefix_list : list of str, default ['test_']
109+
A prefix list of function name conditions to ignore.
110110
ignore_info_id_list : list of int, default []
111111
List of IDs to ignore lint checking. A constant with a
112-
suffix of `INFO_ID_` can be specified.
112+
prefix of `INFO_ID_` can be specified.
113113
enable_default_or_optional_doc_check : bool, default False
114114
If True specified, the `default` and `optional` string
115115
in docstring will be checked.
@@ -135,15 +135,15 @@ def check_jupyter_notebook_recursively(
135135
dir_path=dir_path,
136136
info_list=[],
137137
verbose=verbose,
138-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
138+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
139139
ignore_info_id_list=ignore_info_id_list,
140140
enable_default_or_optional_doc_check=enable_def_or_opt_check)
141141
return info_list
142142

143143

144144
def _check_jupyter_notebook_recursively(
145145
dir_path, info_list, verbose,
146-
ignore_func_name_suffix_list, ignore_info_id_list,
146+
ignore_func_name_prefix_list, ignore_info_id_list,
147147
enable_default_or_optional_doc_check):
148148
"""
149149
Check docstring of Jupyter notebook recursively.
@@ -158,11 +158,11 @@ def _check_jupyter_notebook_recursively(
158158
Log settings of stdout. Specify one of the following numbers:
159159
- 0 -> Do not output log.
160160
- 1 -> Output the check result.
161-
ignore_func_name_suffix_list : list of str
162-
A suffix list of function name conditions to ignore.
161+
ignore_func_name_prefix_list : list of str
162+
A prefix list of function name conditions to ignore.
163163
ignore_info_id_list : list of int
164164
List of IDs to ignore lint checking. A constant with a
165-
suffix of `INFO_ID_` can be specified.
165+
prefix of `INFO_ID_` can be specified.
166166
enable_default_or_optional_doc_check : bool
167167
If True specified, the `default` and `optional` string
168168
in docstring will be checked.
@@ -188,7 +188,7 @@ def _check_jupyter_notebook_recursively(
188188
dir_path=path,
189189
info_list=info_list,
190190
verbose=verbose,
191-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
191+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
192192
ignore_info_id_list=ignore_info_id_list,
193193
enable_default_or_optional_doc_check=enable_def_or_opt_check)
194194
continue
@@ -197,7 +197,7 @@ def _check_jupyter_notebook_recursively(
197197
unit_info_list = check_jupyter_notebook(
198198
notebook_path=path,
199199
verbose=verbose,
200-
ignore_func_name_suffix_list=ignore_func_name_suffix_list,
200+
ignore_func_name_prefix_list=ignore_func_name_prefix_list,
201201
ignore_info_id_list=ignore_info_id_list,
202202
enable_default_or_optional_doc_check=enable_def_or_opt_check)
203203
info_list.extend(unit_info_list)
@@ -246,7 +246,7 @@ def _print_info_list(info_list, verbose):
246246

247247
def _check_unit_code_cell_str(
248248
notebook_path, code_cell_idx, code_cell_str,
249-
ignore_func_name_suffix_list, ignore_info_id_list,
249+
ignore_func_name_prefix_list, ignore_info_id_list,
250250
enable_default_or_optional_doc_check):
251251
"""
252252
Check the single code cell.
@@ -259,11 +259,11 @@ def _check_unit_code_cell_str(
259259
Index of target code cell.
260260
code_cell_str : str
261261
Code string of target cell.
262-
ignore_func_name_suffix_list : list of str
263-
A suffix list of function name conditions to ignore.
262+
ignore_func_name_prefix_list : list of str
263+
A prefix list of function name conditions to ignore.
264264
ignore_info_id_list : list of int
265265
List of IDs to ignore lint checking. A constant with a
266-
suffix of `INFO_ID_` can be specified.
266+
prefix of `INFO_ID_` can be specified.
267267
enable_default_or_optional_doc_check : bool
268268
If True specified, the `default` and `optional` string
269269
in docstring will be checked.
@@ -289,7 +289,7 @@ def _check_unit_code_cell_str(
289289
for func_name in func_name_list:
290290
is_func_name_to_ignore = py_module.is_func_name_to_ignore(
291291
func_name=func_name,
292-
ignore_func_name_suffix_list=ignore_func_name_suffix_list)
292+
ignore_func_name_prefix_list=ignore_func_name_prefix_list)
293293
if is_func_name_to_ignore:
294294
continue
295295
single_func_info_list = py_module.get_single_func_info_list(

0 commit comments

Comments
 (0)