Enum Class PythonExtraPadding.Location

java.lang.Object
java.lang.Enum<PythonExtraPadding.Location>
org.openrewrite.python.marker.PythonExtraPadding.Location
All Implemented Interfaces:
Serializable, Comparable<PythonExtraPadding.Location>, Constable
Enclosing class:
PythonExtraPadding

public static enum PythonExtraPadding.Location extends Enum<PythonExtraPadding.Location>
  • Enum Constant Details

    • AFTER_DECORATOR

      public static final PythonExtraPadding.Location AFTER_DECORATOR
      The method and class models don't support right-padding of decorators. In Python, they're padded like statements and must be newline-terminated. It's more natural to store trailing padding (which is unusual) with the decorator rather than with the next sibling.
            \@foo⇒❘ # a comment❘⇐
            \@bar
            def method():
                pass
       
    • BEFORE_COMPOUND_BLOCK_COLON

      public static final PythonExtraPadding.Location BEFORE_COMPOUND_BLOCK_COLON
            if someCondition⇒
                pass
       
    • IMPORT_PARENS_PREFIX

      public static final PythonExtraPadding.Location IMPORT_PARENS_PREFIX
      Imports can optionally be wrapped in parens.
            from math import⇒
                sin,
                cos
            )
       
    • IMPORT_PARENS_SUFFIX

      public static final PythonExtraPadding.Location IMPORT_PARENS_SUFFIX
      Imports can optionally be wrapped in parens.
            from math import (
                sin,
                cos⇒
            )
       
    • WITHIN_OPERATOR_NAME

      public static final PythonExtraPadding.Location WITHIN_OPERATOR_NAME
      Some Python operators have space within the operator itself.
            if x is⇒ not y:
                pass
       
    • EMPTY_INITIALIZER

      public static final PythonExtraPadding.Location EMPTY_INITIALIZER
      Some Python containers (like dict literals) can have space between the initialization delimiters but lack the space for it in the model.
            xs = {⇒ }
       
  • Method Details

    • values

      public static PythonExtraPadding.Location[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PythonExtraPadding.Location valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null