black/tests/data
Yilei "Dolee" Yang 55db05519e
Fix a crash when # fmt: on is used on a different block level than # fmt: off (#3281)
Previously _Black_ produces invalid code because the `# fmt: on` is used on a different block level.

While _Black_ requires `# fmt: off` and `# fmt: on` to be used at the same block level, incorrect usage shouldn't cause crashes.

The formatting behavior this PR introduces is, the code below the initial `# fmt: off` block level will be turned off for formatting, when `# fmt: on` is used on a different level or there is no `# fmt: on`. This also matches the current behavior when `# fmt: off` is used at the top-level without a matching `# fmt: on`, it turns off formatting for everything below `# fmt: off`.

- Fixes #2567
- Fixes #3184
- Fixes #2985
- Fixes #2882
- Fixes #2232
- Fixes #2140
- Fixes #1817
- Fixes #569
2022-09-23 20:37:22 -07:00
..
fast Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
include_exclude_tests Do not use gitignore if explicitly passing excludes (#2170) 2021-05-07 14:54:21 +02:00
invalid_gitignore_tests Present a more user-friendly error if .gitignore is invalid (#2414) 2021-08-20 19:54:53 -04:00
invalid_nested_gitignore_tests Present a more user-friendly error if .gitignore is invalid (#2414) 2021-08-20 19:54:53 -04:00
jupyter Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
miscellaneous Remove invalid syntax in docstrings -S --preview test (#3205) 2022-08-02 17:22:04 -04:00
nested_gitignore_tests Fix: black only respects the root gitignore. (#2225) 2021-05-16 13:51:27 -04:00
preview Fix a crash on dicts with paren-wrapped long string keys (#3262) 2022-09-13 23:23:51 -04:00
preview_39 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
preview_310 Use underscores instead of a space in a test file's name (#3180) 2022-07-19 21:33:00 -04:00
py_36 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_37 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_38 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_39 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_310 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_311 Implement support for PEP 646 (#3071) 2022-05-26 09:45:22 -07:00
simple_cases Fix a crash when # fmt: on is used on a different block level than # fmt: off (#3281) 2022-09-23 20:37:22 -07:00
empty_pyproject.toml Support pyproject.toml 2018-06-06 17:02:10 -07:00