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

Fix #7868: Added lint check for a newline above args in python doc string #7929

Merged
merged 5 commits into from
Nov 12, 2019

Conversation

Hudda
Copy link
Contributor

@Hudda Hudda commented Nov 6, 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 -m scripts.pre_commit_linter and python -m scripts.run_frontend_tests.
  • The PR is made from a branch that's not called "develop".
  • The PR has an appropriate "PROJECT: ..." label (Please add this label for the first-pass review of the PR).
  • The PR has an appropriate "CHANGELOG: ..." label (If you are unsure of which label to add, ask the reviewers for guidance).
  • The PR follows the style guide.
  • The PR addresses the points mentioned in the codeowner checks for the files/folders changed. (See the codeowner's wiki page.)
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer and don't tick this checkbox.
    • 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. Do not only request the review but also add the reviewer as an assignee.

@Hudda Hudda requested a review from kevinlee12 as a code owner November 6, 2019 03:46
@oppiabot
Copy link

oppiabot bot commented Nov 6, 2019

Hi, @Hudda. This pull request does not have a "CHANGELOG: ..." label as mentioned in the PR checkbox list. Please add this label. PRs without this label will not be merged. If you are unsure of which label to add, please ask the reviewers for guidance. Thanks!

@oppiabot
Copy link

oppiabot bot commented Nov 6, 2019

Assigning @kevinlee12 for the first-pass review of this pull request. Thanks!

Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

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

thanks @Hudda, I also had 2 more cases that we should cover, please also add more if you can think of anymore. ptal!

scripts/pylint_extensions_test.py Show resolved Hide resolved
@kevinlee12 kevinlee12 assigned Hudda and unassigned kevinlee12 Nov 6, 2019
@codecov
Copy link

codecov bot commented Nov 6, 2019

Codecov Report

Merging #7929 into develop will decrease coverage by <.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #7929      +/-   ##
===========================================
- Coverage    83.95%   83.95%   -<.01%     
===========================================
  Files         1150     1150              
  Lines        68641    68641              
  Branches      3933     3933              
===========================================
- Hits         57622    57621       -1     
- Misses        9667     9668       +1     
  Partials      1352     1352
Flag Coverage Δ
#backend 100% <ø> (ø) ⬆️
#frontend 73.62% <ø> (ø) ⬇️
Impacted Files Coverage Δ
...mplates/dev/head/services/id-generation.service.ts 83.33% <0%> (-16.67%) ⬇️

@Hudda Hudda requested a review from kevinlee12 November 6, 2019 06:40
Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

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

thanks @Hudda, I have more comments, ptal! By the way, once you are done addressing my comments, please ping me and/or assign this PR back to me.

"""Checker for single space above args in python doc string."""

__implements__ = interfaces.IRawChecker
name = 'single-space-above-args'
Copy link
Contributor

Choose a reason for hiding this comment

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

single-space-above-args-raises-returns


class SingleNewlineAboveArgsCheckerTests(unittest.TestCase):

def test_checks_newline_above_docstring(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Split up this test and more tests with varying combinations of args/returns/raises with and without spaces. (There should be at least 8 cases to cover all of them).

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.

You still haven't split up the tests yet. Specifically, what I mean is to break this method up so that you have multiple def test_....

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

@Hudda
Copy link
Contributor Author

Hudda commented Nov 7, 2019

@kevinlee12 ptal! and how do I assign you?

@kevinlee12
Copy link
Contributor

it looks like you don't have permissions to do so. for the future, just ping me 😄

@kevinlee12
Copy link
Contributor

@Hudda I've left a comment for you!

@Hudda
Copy link
Contributor Author

Hudda commented Nov 12, 2019

@kevinlee12 ptal!

Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @Hudda!

@kevinlee12 kevinlee12 merged commit cb99e89 into oppia:develop Nov 12, 2019
@Hudda Hudda deleted the newline branch November 12, 2019 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add lint check to ensure that there is a newline above args in python doc string
2 participants