---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off/fmt_off_docstring.py
---
## Input
```python
def test():
    # fmt: off
    """ This docstring does not
        get formatted
    """

    # fmt: on

    but + this  + does

def test():
    # fmt: off
        # just for fun
    # fmt: on
        # leading comment
    """   This docstring gets formatted
    """ # trailing comment

    and_this +  gets + formatted + too
```

## Outputs
### Output 1
```
indent-style               = space
line-width                 = 88
indent-width               = 4
quote-style                = Double
line-ending                = LineFeed
magic-trailing-comma       = Respect
docstring-code             = Disabled
docstring-code-line-width  = "dynamic"
preview                    = Disabled
target_version             = Py38
source_type                = Python
```

```python
def test():
    # fmt: off
    """ This docstring does not
        get formatted
    """

    # fmt: on

    but + this + does


def test():
    # fmt: off
        # just for fun
    # fmt: on
    # leading comment
    """This docstring gets formatted"""  # trailing comment

    and_this + gets + formatted + too
```


### Output 2
```
indent-style               = space
line-width                 = 88
indent-width               = 2
quote-style                = Double
line-ending                = LineFeed
magic-trailing-comma       = Respect
docstring-code             = Disabled
docstring-code-line-width  = "dynamic"
preview                    = Disabled
target_version             = Py38
source_type                = Python
```

```python
def test():
  # fmt: off
  """ This docstring does not
        get formatted
    """

  # fmt: on

  but + this + does


def test():
  # fmt: off
      # just for fun
  # fmt: on
  # leading comment
  """This docstring gets formatted"""  # trailing comment

  and_this + gets + formatted + too
```



