Skip to content
New issue

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

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

Already on GitHub? # to your account

False positive D402 when mentioning a different function that has the function name as suffix #13242

Closed
Daraan opened this issue Sep 4, 2024 · 1 comment · Fixed by #13388
Assignees
Labels
bug Something isn't working docstring Related to docstring linting or formatting

Comments

@Daraan
Copy link

Daraan commented Sep 4, 2024

I stumbled on the following false positive cases where the mention of prefix_foo flags a D402 on a function called foo

def foo(self):
    """ Use prefix_foo() """
    # ^^^^^^^^^^^^^^^^^^^ D402

Version: ruff 0.6.3

Command: ruff check . --select D402 --isolated

Related #3769; where the same function is mentioned explicitly without a prefix.

@dhruvmanila dhruvmanila added bug Something isn't working docstring Related to docstring linting or formatting labels Sep 5, 2024
@dhruvmanila
Copy link
Member

I think we can solve this by using whole words instead, so look for foo and not any words that ends with foo. Curious to know what the ecosystem changes would look like.

@Daraan Daraan changed the title False positive D402 when mentioning a different function that has the fuction as suffix False positive D402 when mentioning a different function that has the function name as suffix Sep 5, 2024
@charliermarsh charliermarsh self-assigned this Sep 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working docstring Related to docstring linting or formatting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants