8000 Changes to validate_docstring script to be able to check all docstrings at once by datapythonista · Pull Request #22408 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Changes to validate_docstring script to be able to check all docstrings at once #22408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing pep8
  • Loading branch information
datapythonista committed Sep 28, 2018
commit 3a5e7fd823462f8b899bd154adc03280aa4b57d2
14 changes: 7 additions & 7 deletions scripts/validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ def first_line_ends_in_dot(self):
@property
def deprecated(self):
pattern = re.compile('.. deprecated:: ')
return (self.name.startswith('pandas.Panel') or
bool(pattern.search(self.summary)) or
bool(pattern.search(self.extended_summary)))
return (self.name.startswith('pandas.Panel')
or bool(pattern.search(self.summary))
or bool(pattern.search(self.extended_summary)))

@property
def mentioned_private_classes(self):
Expand Down Expand Up @@ -440,8 +440,8 @@ def validate_one(func_name):
errs.append('Summary does not end with a period')
if doc.summary != doc.summary.lstrip():
errs.append('Summary contains heading whitespaces.')
elif (doc.is_function_or_method and
doc.summary.split(' ')[0][-1] == 's'):
elif (doc.is_function_or_method
and doc.summary.split(' ')[0][-1] == 's'):
errs.append('Summary must start with infinitive verb, '
'not third person (e.g. use "Generate" instead of '
'"Generates")')
Expand Down Expand Up @@ -553,8 +553,8 @@ def validate_all():
for class_ in (pandas.Series, pandas.DataFrame, pandas.Panel):
for member in inspect.getmembers(class_):
func_name = 'pandas.{}.{}'.format(class_.__name__, member[0])
if (not member[0].startswith('_') and
func_name not in api_item_names):
if (not member[0].startswith('_')
and func_name not in api_item_names):
doc_info = validate_one(func_name)
result[func_name] = doc_info
result[func_name]['in_api'] = False
Expand Down
0