Skip to content

Clash with black formatter (new line after module docstring) #366

Closed

Description

@elagil

reorder-python-imports worked together fine with black up to version 23. From version 24, black seems to have introduced a forced new line after the module docstring.

reorder-python-imports apparently forces no new line after the module docstring.

How can I use the two together as pre-commit hooks without conflict? Neither seems to be configurable in this regard.

Thanks in advance

Activity

  1. asottile commented on Jan 26, 2024

    @asottile
    Owner

    open an issue with black then

  2. maxwell-k commented on Jan 26, 2024

    @maxwell-k

    First: I'm a huge fan of reorder-python imports, thank you! Second I followed your suggestion and opened psf/black#4175. Please allow me to ask:

    Do you think its possible that any future version of reorder-python-imports might allow or preserve a blank line between a module level doc-string at the top of a file and the first import?

    The behaviour I'm asking about is:

    """Module docstring."""
    
    import typing
    

    In place of:

    """Module docstring."""
    import typing
    
  3. asottile commented on Jan 26, 2024

    @asottile
    Owner

    anything is possible. will it happen here: no

  4. Repository owner locked as resolved and limited conversation to collaborators on Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions