Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Skip function arguments prefixed with _ in D417 check #440

Merged
merged 1 commit into from Feb 29, 2020

Conversation

samj1912
Copy link
Member

These arguments have been marked private. As such,
it should be okay for the checker to not validate their
existence in the docstring,

Thanks for submitting a PR!

Please make sure to check for the following items:

  • Add unit tests and integration tests where applicable.
    If you've added an error code or changed an error code behavior,
    you should probably add or change a test case file under tests/test_cases/ and add
    it to the list under tests/test_definitions.py.
    If you've added or changed a command line option,
    you should probably add or change a test in tests/test_integration.py.
  • Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.

Please don't get discouraged as it may take a while to get a review.

Fixes #438

@samj1912
Copy link
Member Author

@Nurdok review please :)

@@ -764,6 +764,9 @@ def _check_missing_args(docstring_args, definition):
# positional argument as it is `cls` or `self`
if definition.kind == 'method' and not definition.is_static:
function_args = function_args[1:]
# Filtering out any arguments prefixed with `_` marking them
# as private.
function_args = [arg for arg in function_args if not arg.startswith("_")]
Copy link
Member

Choose a reason for hiding this comment

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

Can you extract this logic to a function? e.g., is_def_arg_private. The code will have clearer intent (if not is_def_arg_private(arg)) and can be reused.

@Nurdok
Copy link
Member

Nurdok commented Dec 24, 2019

Please also add a release notes line.

These arguments have been marked private. As such,
it should be okay for the checker to not validate their
existence in the docstring,
@samj1912
Copy link
Member Author

@Nurdok done. Sorry for the late update. Holiday time.

@samj1912
Copy link
Member Author

@Nurdok bump

@Nurdok Nurdok merged commit 832fd11 into PyCQA:master Feb 29, 2020
@samj1912 samj1912 deleted the unused branch February 29, 2020 07:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

D417: Ignore arguments marked as unused
2 participants