Skip to content
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

Enable missing docstrings check #6073

Merged
merged 4 commits into from
Jan 9, 2019

Conversation

vibhor98
Copy link
Contributor

@vibhor98 vibhor98 commented Jan 7, 2019

Explanation

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR follows the style guide.
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue.

@nithusha21
Copy link
Contributor

Hi @vibhor98 failing lint checks... I think you need add docstrings in a few more locations.

@codecov-io
Copy link

codecov-io commented Jan 8, 2019

Codecov Report

Merging #6073 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6073   +/-   ##
========================================
  Coverage    45.21%   45.21%           
========================================
  Files          523      523           
  Lines        30722    30722           
  Branches      4605     4605           
========================================
  Hits         13892    13892           
  Misses       16830    16830

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35c2f13...a32e79e. Read the comment docs.

Copy link
Contributor

@nithusha21 nithusha21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR looks ok. Finally we finish the docstrings :) Great work @vibhor98! Left a few comments

scripts/pre_commit_linter.py Show resolved Hide resolved
core/domain/user_services_test.py Outdated Show resolved Hide resolved
core/domain/user_services_test.py Outdated Show resolved Hide resolved
scripts/pre_commit_linter.py Show resolved Hide resolved
@vibhor98
Copy link
Contributor Author

vibhor98 commented Jan 8, 2019

Hi @seanlip, Can you review this PR as all lint checks have been passed? Thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

Please resolve @nithusha21's comments too.

core/tests/test_utils_test.py Outdated Show resolved Hide resolved
@@ -203,6 +203,9 @@ def test_interaction_properties(self):
def test_interaction_rules(self):
"""Tests the interaction rules."""
def _check_num_interaction_rules(interaction_id, expected_num):
"""Checks the number of rules in the interaction corresponding to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing args section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you said test files didn't need args/returns/raises. Does the linter fail if the test files don't have all the sections of the docstring? If not, can you point me to the code that skips checking these sections on test files?

/cc @apb7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they're optional. No, the linter doesn't fail as we don't have explicit checks for missing Args and Return sections yet.

scripts/pre_commit_linter.py Outdated Show resolved Hide resolved
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Congrats @vibhor98!

@nithusha21
Copy link
Contributor

Also, some questions Now what is the behavior of the linter?

  1. Does it raise linting errors if a docstring is missing?
  2. Does it raise linting errors if a part of the docstring is missing (like the args/returns/raises)?
  3. Does it raise errors of type 2 only for files that aren't test files?
  4. Does it raise errors of type 1 for all python files?

Could you or @apb7 clarify here? Thanks!

@vibhor98
Copy link
Contributor Author

vibhor98 commented Jan 9, 2019

Hi @nithusha21, now the linter will raise errors for missing docstrings for all the non-test and test Python files. But we don't have explicit checks for missing sections yet. Thanks!

@nithusha21
Copy link
Contributor

Ah I see, Thanks for confirming. I think this can be merged as #6081 tracks the different sections issue.

@nithusha21
Copy link
Contributor

Thanks for completing this! @vibhor98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants