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

D400: bad autofix if the first line ends in a question mark #13365

Closed
AlexWaygood opened this issue Sep 16, 2024 · 3 comments · Fixed by #13399
Closed

D400: bad autofix if the first line ends in a question mark #13365

AlexWaygood opened this issue Sep 16, 2024 · 3 comments · Fixed by #13399
Assignees
Labels
bug Something isn't working docstring Related to docstring linting or formatting fixes Related to suggested fixes for violations help wanted Contributions especially welcome

Comments

@AlexWaygood
Copy link
Member

The autofix for D400 currently changes this:

def should_frob() -> bool:
    """Should we frob the bar?"""

To this:

def should_frob() -> bool:
    """Should we frob the bar?."""

Which seems pretty clearly worse! We probably just shouldn't offer an autofix if the first line ends in a question mark or exclamation mark?

List of keywords you searched for before creating this issue:

  • D400
  • ends-in-period
@AlexWaygood AlexWaygood added bug Something isn't working docstring Related to docstring linting or formatting fixes Related to suggested fixes for violations help wanted Contributions especially welcome labels Sep 16, 2024
@yahayaohinoyi
Copy link
Contributor

can i get assighned to this?

@yahayaohinoyi
Copy link
Contributor

would send PR by EOD

@yahayaohinoyi
Copy link
Contributor

yahayaohinoyi commented Sep 18, 2024

First attempt: #13399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docstring Related to docstring linting or formatting fixes Related to suggested fixes for violations help wanted Contributions especially welcome
Projects
None yet
2 participants