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

Reformat on comment ignore # fmt: off & # fmt: on #1611

Closed
xinbinhuang opened this issue Aug 18, 2020 · 1 comment
Closed

Reformat on comment ignore # fmt: off & # fmt: on #1611

xinbinhuang opened this issue Aug 18, 2020 · 1 comment
Labels
F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. F: fmtoff fmt: off implementation T: bug Something isn't working

Comments

@xinbinhuang
Copy link

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Before formatting:

class A:
    ........

    minutes_available_per_week = models.PositiveIntegerField(
        # fmt: off
        default=settings.TIME_ESTIMATES["defaults"]["minutes_available_per_week"]  # type: ignore
        # fmt: on
    )

After formatting:

    minutes_available_per_week = models.PositiveIntegerField(
        # fmt: off
        default=settings.TIME_ESTIMATES["defaults"]["minutes_available_per_week"]
        # type: ignore
        # fmt: on
    )

Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Version: [e.g. master]: 19.10b0
  • OS and Python version: [e.g. Linux/Python 3.7.4rc1] Linux (WSL2): 3.7

Does this bug also happen on master? To answer this, you have two options:

Yes

  1. Use the online formatter at https://black.now.sh/?version=master, which will use the
    latest master branch.
  2. Or run Black on your machine:
    • create a new virtualenv (make sure it's the same Python version);
    • clone this repository;
    • run pip install -e .;
    • make sure it's sane by running python -m unittest; and
    • run black like you did last time.

Additional context Add any other context about the problem here.

@xinbinhuang xinbinhuang added the T: bug Something isn't working label Aug 18, 2020
@ichard26 ichard26 added the F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. label Aug 19, 2020
@JelleZijlstra JelleZijlstra added the F: fmtoff fmt: off implementation label May 30, 2021
@JelleZijlstra
Copy link
Collaborator

Duplicate of #1245

@JelleZijlstra JelleZijlstra marked this as a duplicate of #1245 May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. F: fmtoff fmt: off implementation T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants