@@ -414,10 +414,9 @@ def foo(a: (int), b: (float) = 7): ...
414414 yield from self .visit_default (node )
415415
416416 def visit_STRING (self , leaf : Leaf ) -> Iterator [Line ]:
417- if Preview .hex_codes_in_unicode_sequences in self .mode :
418- normalize_unicode_escape_sequences (leaf )
417+ normalize_unicode_escape_sequences (leaf )
419418
420- if is_docstring (leaf , self . mode ) and not re .search (r"\\\s*\n" , leaf .value ):
419+ if is_docstring (leaf ) and not re .search (r"\\\s*\n" , leaf .value ):
421420 # We're ignoring docstrings with backslash newline escapes because changing
422421 # indentation of those changes the AST representation of the code.
423422 if self .mode .string_normalization :
@@ -488,10 +487,7 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]:
488487 and len (indent ) + quote_len <= self .mode .line_length
489488 and not has_trailing_backslash
490489 ):
491- if (
492- Preview .docstring_check_for_newline in self .mode
493- and leaf .value [- 1 - quote_len ] == "\n "
494- ):
490+ if leaf .value [- 1 - quote_len ] == "\n " :
495491 leaf .value = prefix + quote + docstring + quote
496492 else :
497493 leaf .value = prefix + quote + docstring + "\n " + indent + quote
@@ -511,10 +507,7 @@ def visit_NUMBER(self, leaf: Leaf) -> Iterator[Line]:
511507
512508 def visit_atom (self , node : Node ) -> Iterator [Line ]:
513509 """Visit any atom"""
514- if (
515- Preview .remove_lone_list_item_parens in self .mode
516- and len (node .children ) == 3
517- ):
510+ if len (node .children ) == 3 :
518511 first = node .children [0 ]
519512 last = node .children [- 1 ]
520513 if (first .type == token .LSQB and last .type == token .RSQB ) or (
@@ -602,8 +595,7 @@ def __post_init__(self) -> None:
602595 # PEP 634
603596 self .visit_match_stmt = self .visit_match_case
604597 self .visit_case_block = self .visit_match_case
605- if Preview .remove_redundant_guard_parens in self .mode :
606- self .visit_guard = partial (v , keywords = Ø , parens = {"if" })
598+ self .visit_guard = partial (v , keywords = Ø , parens = {"if" })
607599
608600
609601def _hugging_power_ops_line_to_string (
@@ -1132,12 +1124,7 @@ def _ensure_trailing_comma(
11321124 return False
11331125 # Don't add commas if we already have any commas
11341126 if any (
1135- leaf .type == token .COMMA
1136- and (
1137- Preview .typed_params_trailing_comma not in original .mode
1138- or not is_part_of_annotation (leaf )
1139- )
1140- for leaf in leaves
1127+ leaf .type == token .COMMA and not is_part_of_annotation (leaf ) for leaf in leaves
11411128 ):
11421129 return False
11431130
@@ -1418,11 +1405,7 @@ def normalize_invisible_parens( # noqa: C901
14181405 )
14191406
14201407 # Add parentheses around if guards in case blocks
1421- if (
1422- isinstance (child , Node )
1423- and child .type == syms .guard
1424- and Preview .parens_for_long_if_clauses_in_case_block in mode
1425- ):
1408+ if isinstance (child , Node ) and child .type == syms .guard :
14261409 normalize_invisible_parens (
14271410 child , parens_after = {"if" }, mode = mode , features = features
14281411 )
0 commit comments