-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
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! |
Assigning @kevinlee12 for the first-pass review of this pull request. Thanks! |
There was a problem hiding this 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!
Codecov Report
@@ 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
|
There was a problem hiding this 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.
scripts/pylint_extensions.py
Outdated
"""Checker for single space above args in python doc string.""" | ||
|
||
__implements__ = interfaces.IRawChecker | ||
name = 'single-space-above-args' |
There was a problem hiding this comment.
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
scripts/pylint_extensions_test.py
Outdated
|
||
class SingleNewlineAboveArgsCheckerTests(unittest.TestCase): | ||
|
||
def test_checks_newline_above_docstring(self): |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
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_....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@kevinlee12 ptal! and how do I assign you? |
it looks like you don't have permissions to do so. for the future, just ping me 😄 |
@Hudda I've left a comment for you! |
@kevinlee12 ptal! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @Hudda!
Explanation
Fixes Add lint check to ensure that there is a newline above args in python doc string #7868
Added lint check to ensure that there is a new line above args in python doc string.
Checklist
python -m scripts.pre_commit_linter
andpython -m scripts.run_frontend_tests
.