black/tests/data
Lawrence Chan 23fec8b0f7 Fix fmt on/off when multiple exist in leaf prefix (#1086)
The old behavior would detect the existence of a `# fmt: on` in a leaf
node's comment prefix and immediately mark the node as formatting-on,
even if a subsequent `# fmt: off` in the same comment prefix would turn
it back off. This change modifies that logic to track the state through
the entire prefix and take the final state.

Note that this does not fully solve on/off behavior, since any _comment_
lines between the off/on are still formatted. We may need to add
virtual leaf nodes to truly solve that. I will leave that for a separate
commit/PR.

Fixes #1005
2019-10-28 20:51:45 +01:00
..
include_exclude_tests/b Move test data to data 2018-06-06 15:48:38 -07:00
async_as_identifier.py Add support for always tokenizing async/await as keywords 2019-05-09 17:59:29 +02:00
beginning_backslash.py Fix unstable format involving backslash + whitespace at beginning of file (#948) 2019-08-04 10:03:19 +01:00
blackd_diff.diff Add diff support to blackd (#969) 2019-10-28 14:25:26 +01:00
blackd_diff.py Add diff support to blackd (#969) 2019-10-28 14:25:26 +01:00
bracketmatch.py fix bracket match bug (#470) 2018-08-23 12:52:07 +01:00
cantfit.py Pin comment to single leaf in invisible parens (#872) 2019-06-15 07:29:09 +01:00
class_blank_parentheses.py Move test data to data 2018-06-06 15:48:38 -07:00
class_methods_new_line.py Move test data to data 2018-06-06 15:48:38 -07:00
collections.py line_length=1 to reduce churn (#1092) 2019-10-28 15:25:42 +01:00
comment_after_escaped_newline.py Avoid unstable formatting when comment follows escaped newline. (#839). Fixes #767. 2019-05-08 09:53:20 -04:00
comments2.py fix CI (#1078) 2019-10-20 08:35:57 -07:00
comments3.py Fix mangling pweave and Spyder IDE special comments 2018-09-26 09:42:42 -07:00
comments4.py Add trailing comma for single as imports, too 2018-09-26 08:26:35 -07:00
comments5.py Move test data to data 2018-06-06 15:48:38 -07:00
comments6.py Fix type: ignore line breaking when there is a destructuring assignment (#1065) 2019-10-14 18:15:18 -07:00
comments7.py Tweak collection literals to explode with trailing comma (#826) 2019-10-20 16:08:34 +02:00
comments.py Avoid unstable formatting when comment follows escaped newline. (#839). Fixes #767. 2019-05-08 09:53:20 -04:00
composition.py line_length=1 to reduce churn (#1092) 2019-10-28 15:25:42 +01:00
debug_visitor.out Move INDENT value to the postponed prefix 2018-06-19 20:44:47 -07:00
debug_visitor.py Move test data to data 2018-06-06 15:48:38 -07:00
empty_lines.py Move test data to data 2018-06-06 15:48:38 -07:00
empty_pyproject.toml Support pyproject.toml 2018-06-06 17:02:10 -07:00
expression.diff Back out #850 (#1079) 2019-10-20 09:02:17 -07:00
expression.py Back out #850 (#1079) 2019-10-20 09:02:17 -07:00
fmtonoff2.py Move INDENT value to the postponed prefix 2018-06-19 20:44:47 -07:00
fmtonoff3.py Fix fmt on/off when multiple exist in leaf prefix (#1086) 2019-10-28 20:51:45 +01:00
fmtonoff.py Fix fmt on/off when multiple exist in leaf prefix (#1086) 2019-10-28 20:51:45 +01:00
force_py36.py Move test data to data 2018-06-06 15:48:38 -07:00
force_pyi.py Move test data to data 2018-06-06 15:48:38 -07:00
fstring.py Fix string normalization sometimes producing invalid fstrings (#327) 2018-06-09 12:30:49 -07:00
function2.py Fix regression: unexpected parentheses around non-mathematical powers 2019-10-28 14:55:24 +01:00
function_trailing_comma.py fix crash with long type annotations (#1093) 2019-10-27 11:31:10 +00:00
function.py Tweak collection literals to explode with trailing comma (#826) 2019-10-20 16:08:34 +02:00
import_spacing.py Add trailing comma when a single import doesn't fit on a line. (#504) 2018-09-26 13:26:50 +01:00
numeric_literals_py2.py Uppercase digits in hex literals (#530) 2018-09-25 16:01:56 +01:00
numeric_literals_skip_underscores.py Add underscores to numeric literals with more than six digits (#529) 2018-09-26 12:32:11 +01:00
numeric_literals.py Remove numeric underscore normalization (#696) 2019-02-06 19:16:49 -08:00
pep_570.py Support PEP-570 (positional only arguments) (#946) 2019-07-28 16:17:33 +01:00
pep_572.py fix tests 2019-09-18 13:33:14 +01:00
python2_print_function.py Fix print() function on Python 2 (#754) 2019-03-14 16:42:54 -07:00
python2_unicode_literals.py Improve get_future_imports implementation. 2018-07-02 17:49:47 +01:00
python2.py Move test data to data 2018-06-06 15:48:38 -07:00
python37.py Move tokenizer config onto grammar, rename flag 2019-05-09 17:59:29 +02:00
remove_parens.py Back out #850 (#1079) 2019-10-20 09:02:17 -07:00
slices.py Move test data to data 2018-06-06 15:48:38 -07:00
string_prefixes.py Move test data to data 2018-06-06 15:48:38 -07:00
string_quotes.py Don't introduce quotes to f-string sub-expressions on string boundaries (#871) 2019-05-26 11:58:00 +02:00
stub.pyi Add blank line after constants in stub file (#360) 2018-06-16 11:53:45 -07:00
tricky_unicode_symbols.py #455 Fix bug with tricky unicode symbols (#1047) 2019-10-13 10:21:15 -07:00
tupleassign.py Always move the prefix out when wrapping with parentheses (#1103) 2019-10-28 20:34:37 +01:00