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

Contradict with black #375

Closed
mariostg opened this issue Apr 11, 2024 · 1 comment
Closed

Contradict with black #375

mariostg opened this issue Apr 11, 2024 · 1 comment

Comments

@mariostg
Copy link

In my pre-commit yml file, I use both black and reorder-python-import. Black keeps placing a space between the import and the last """ while reorder-python-import removes it which yields to both hooks failing. It does not matter in which order I place the hooks in the pre-commit config file.

Typical case file:

"""
WSGI config for main project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")

application = get_wsgi_application()

Pre-commit hooks:

-   repo: https://github.com/asottile/reorder-python-imports
    rev: v3.12.0
    hooks:
    -   id: reorder-python-imports
    args:
    - --py311-plus
 
-   repo: https://github.com/psf/black-pre-commit-mirror
    rev: "24.3.0"
    hooks:
    - id: black
@asottile
Copy link
Owner

search the issue tracker next time before opening an issue

Repository owner locked as off-topic and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants